Questions tagged as 'mysql'

1
answer

Error in DateTime attribute in C # writing to MySQL

I am trying to insert into MySQL database the date of birth of the user, in C # the attribute date_match is of type DateTime and in MySQL the attribute date_match is of type Date , to insert C # I am doing doing so: DateTime nasci...
asked by 28.04.2016 / 13:34
1
answer

Sort MySQL results by preference

I have a produtos table where if there is the primary column id , I want to select products with the probable name of "% TV%" however I want it to be ordered DESC normally, however I want it some IDS come first than ot...
asked by 29.07.2016 / 16:38
1
answer

Adding multiple select count results in MYSQL

I am trying to add all the clients I have in all my databases, so for this I am doing the following query : SET @total = 0; USE BASE x1; SELECT @total:= @total +COUNT(1) FROM clientes; USE BASE x2; SELECT @total:= @total +COUNT(1) FROM clie...
asked by 29.05.2015 / 20:08
1
answer

Passing array as parameter does not work

I need to pass an array as a parameter to a function, each array value has the name of an image, and the function should load each of those images as img/foto1 , img/foto2 , etc. But it is not passing the array values, it is simply p...
asked by 06.06.2015 / 17:04
2
answers

How to create a Stored Procedure for two tables

I'm trying to do this Stored Procedure, but it's giving error. Can I make an insert with proceed? DELIMITER $$ DROP PROCEDURE IF EXISTS 'centralrit'.'sp_InterdDetalhe_Encrypt' $$ CREATE PROCEDURE 'centralrit'.'sp_InterdDetalhe_Encrypt' (...
asked by 22.07.2016 / 02:56
2
answers

ORDER BY WITH GROUP BY to get last row, sql

I am using this SQL code to pick up data, first it groups then it organizes by the birth date of rows . SELECT U.id, U.born_data, U.bold FROM users U GROUP BY U.bold ORDER BY U.born_data DESC In the meantime it does an inversion, it organ...
asked by 01.07.2015 / 16:17
1
answer

SELECT for date format dd / mm / yyyy hh: mm: ss

Inquiry SELECT campo FROM Tabela WHERE data BETWEEN '2016-10-20' AND '2016-10-20' data and a field with type datetime , I'm having problems with records for example that have the following value: 2016-10-20 19:00:00 Da...
asked by 21.10.2016 / 14:03
1
answer

Delphi XE7 / XE8 - Refresh in database (real-time update)

I have two systems interconnected, one saves a record in the database and another reads the saved record, I currently use a timer to refresh the bank on the system that reads, so it picks up every 5 seconds that was saved by But I do not think i...
asked by 07.05.2015 / 18:50
3
answers

Query data from 1 day to 3 days ago mysql [closed]

I'm trying to show records for the last 3 days, but it should be subtracted two days and only demonstrate the value of a single day before the 2 days, I currently have the following code that is demonstrated the value of the last month subtracti...
asked by 03.04.2015 / 17:39
2
answers

Create a column in Mysql that automatically divides the values into two other columns

I need to explain how I can make it similar to what happens in Excel I can create a column in Mysql that divides the values of the other two columns. Something like column 1 / column 2 = column 3. For example I have two columns and several ro...
asked by 01.04.2015 / 20:18