Questions tagged as 'mysql'

1
answer

Detect UPDATE with trigger

My table of entradas you have a field precio , the price is assigned from my other table entrada_detalles automatic by trigger with INSERT my problem is that if in table _detalles the price is modified it does n...
asked by 05.05.2018 / 07:38
1
answer

How to optimize a query that contains two subquery in MySql?

I have the following query: SELECT presupuestosd.partida,presupuestosd.valor, (SELECT SUM(presupuestosa.comprado) AS comprado FROM presupuestosa WHERE presupuestosa.obra=18 AND presupuestosa.empresa=1 AND presupuestosa.partida=presupuestos...
asked by 29.06.2018 / 18:27
0
answers

how to convert from VARCHAR to DATATIME in MYSQL

In my record table, I have a column called date, but I have imported data (15000 data) and at the time of saving it has been saved like this: 01/01/2018 0:09:07 - > but in type VARCHAR (100) I would like to know how I can modify that co...
asked by 08.05.2018 / 19:41
2
answers

Do not show certain records in an sql query

I am making a system of online courses, and in the list of all courses offered to the public I would like to ignore what the user in session has already purchased. I have two tables that are: Courses: |-----------|---------------|-----...
asked by 09.05.2018 / 05:47
0
answers

MySql server "Error No. 2003 Can not connect to Mysql server", I can not connect, I have already changed my.cnf and created remote users help please

I need help guys, my server is running on the Google Cloud platform, I'm going to leave the specs here: mysql version: See 15.1 Distrib 10.1.26-MariaDB, for debian-linux-gnu (x86_64) using readline 5.2 The MySql configuration file is locat...
asked by 26.04.2018 / 23:37
2
answers

Group related records with the highest value in MYSQL

Good morning friends, I have the following query: SELECT i.cod_modular, a.idarchivo, m.descripcion, m.cantidad as cantidades, d.matriculados, (m.cantidad - d.matriculados) as deficit FROM archivo a JOIN iiee i on i.cod_modular = a.iiee_co...
asked by 26.04.2018 / 23:57
0
answers

Update data from one table from others but only to specific users

I am trying to update a table and in the condition I am making two subqueries to validate that the data exists. If I run my queries separately, it shows me the following: SELECT m.id AS membersid, m.name AS username, s.name AS skillname...
asked by 11.05.2018 / 19:01
2
answers

Is it possible to use triggers in the same table in MYSQL?

My problem is that I have a table called students and I want a trigger to trigger when a new student registers, the trigger sends me an email but within the same student table obvious in another field of the same table This is possible? It ge...
asked by 11.05.2018 / 18:16
1
answer

Get select value and use it in the same php file

Hello good morning I have this code is to fill a select with php and mysql but with the value obtained I must make another query to fill the other select depending on the selection of the first, I need to do it in the same file to fill other inp...
asked by 24.04.2018 / 17:33
0
answers

Consult registration within a foreach

I am listing the records from MySQL, there I consult three tables, users, registers, courses, the table that I show is currently with the users' registers, but with the id of the user I should consult in the table records by the id of the user t...
asked by 24.04.2018 / 07:36