Questions tagged as 'mysql'

2
answers

Last record of fields that have the same date MYSQL

I have the following MySQL query: select * from venta as v, pago_venta as pv where pv.pv_fecha in (SELECT MAX(pv_fecha) FROM pago_venta as p GROUP BY ven_id ) AND v.ven_id = pv.ven_id AND v.ven_cliente= 'Amaia Valentina Cardenas Gonzales' T...
asked by 22.08.2017 / 17:24
1
answer

Copy structure of MySQL tables without the data

In MySQL, can I copy the structure? of a table using this command: CREATE TABLE foo SELECT * FROM bar LIMIT 0; By doing this I will have a table foo with the same columns of the table bar , but in the table foo there wil...
asked by 18.08.2017 / 01:12
2
answers

how to make it a single line

I have this query SELECT 'presupuesto_annio_real'.'categoria', IF('clase_canal'.'canal' = 'constructor',sum('presupuesto_annio_real'.'cantidad'),0) as constructorCantidad, IF('clase_canal'.'canal' = 'distribuidor',sum('presupuesto_annio_...
asked by 19.09.2018 / 16:58
3
answers

Create a repetition or route every certain data from an explode

I have the following code: $pal = "3,5 1401 4145 7854 8454 7458 5152556555 3,5 1401 4145 7854 8454 7458 5152556555 3,5 1401 4145 7854 8454 7458 5152556555"; $pal = explode(" ",$pal); print_r($pal); The result is something like this: Array...
asked by 17.09.2018 / 19:17
2
answers

Problem with FK in MySQL

I am somewhat new to the database design and I have the following doubt: I have created a bd called "newdb" in which I create two tables (student and subject) with the following columns: Student table Field Type Null...
asked by 14.09.2017 / 19:27
1
answer

Column not found: 1054 Unknown column 'id' in 'where clause' Laravel 5.3

Greetings, I am updating a table called tbl_articles using the same view where the Primary key = idArticulo, the insert performs me impeccably the problem is when I want to update it generates the error I AM WORKING WITH LARAVEL 5.3 QueryExcep...
asked by 23.05.2017 / 05:56
3
answers

MySQL Workbench change name to Schema

I'm trying to export / migrate a DB from one server to another, I have the 2 connections in Workbench and the problem is that the bases have different names, I want to take the base to export let's call it test and I want to export it t...
asked by 24.03.2017 / 14:28
1
answer

Error 1215: MySQL foreign key can not be added

I am trying to make a Foreign Key to some tables that I have created but MySQL does not allow me, these are the tables: CREATE TABLE publicador(id_publicador INT NOT NULL PRIMARY KEY AUTO_INCREMENT UNIQUE, fecha_publica...
asked by 09.12.2016 / 05:25
3
answers

Do filtering with jquery and php

Good, I have a catalog of products that I did with a while to show all the products that I have in the db, the thing is that the template I use brings some that I would like to use to filter the products, the thing is. Searching I did something...
asked by 24.10.2016 / 01:56
1
answer

Query to show class schedule in MySQL

Good afternoon, I am trying to generate a class schedule and it took several days without being able to generate the schedule through a query in MySQL. The query I'm doing in MySQL is the following: SELECT CONCAT(DATE_FORMAT(h.hora_inicio,"...
asked by 03.10.2016 / 23:07