Questions tagged as 'mysql'

2
answers

Invoices not paid more than 10 days [duplicate]

I have a table of invoices and clients. In the invoice table, for example, I have the fields client_id, status, and date In the customer table id, name, etc ... What I need is to list all invoices, that the status is still Open (in ca...
asked by 22.08.2016 / 15:19
1
answer

Search PHP + SQL can not find results without typing the hyphen "-"

Hello! I have a search for auto products where the user can search for the company code, original code, product line, assembler or vehicle. This system is working if in the search field I type, for example, "E-1001", or "1001", or "E". But if I...
asked by 22.08.2016 / 20:11
0
answers

How to make distinct sorts in tables with Left Join? [closed]

I need your next help. First, see below my current query: sq1 = mysqli($conexao,"select * from tabela1 TBL1 left join tabela2 TBL2 ON TBL1.codigo=TBL2.codigoestrangeiro LEFT JOIN tabela3 TBL3 ON TBL2.codigo=TBL3.codigoestr...
asked by 01.08.2016 / 13:34
1
answer

Select and add records from a table with different fields

Good afternoon everyone, once again I come to ask for help! I have a table with the games played and the boards, I need to show how many games have already been made and the number of goals conceded and made and etc., the problem is that the...
asked by 14.07.2016 / 17:53
1
answer

How do I make a case when no load data infile?

I need to make a replace of the same column of several distinct string, make a load data infile . It just gives a syntax error on line 12 where it has the first case, does anyone know what I'm doing wrong the code is below? LOA...
asked by 12.07.2016 / 16:35
0
answers

Get first SQL record Bullider Laravel [closed]

I can not get the first record without using foreach query = "SELECT *, (SELECT count(*) FROM corridas c WHERE c.motoqueiro = u.id AND (c.status = 0 OR c.status = 1)) as corrida ,distance_between(u.latitude, u.longitude, $lat, $lon) as km FROM...
asked by 02.07.2016 / 16:05
0
answers

Search for data in a log

I'm having trouble seeing where my error is, and also understanding and fixing the delay of query . I have a function in PHP that does the parser of a log generated by OpenVpn . Below I will leave some lines of thi...
asked by 01.07.2016 / 21:59
0
answers

Mysql Trigger with more than one cursor

I have a Trigger where I have 3 cursors, but it only correctly executes one of them (soma_pontuacao_cursor), the other two are executed in the wrong way, I already tried with three separate loops, and it also did not work. My perception says tha...
asked by 03.08.2016 / 10:52
1
answer

Using SUM () in mysql returning incorrect value

I'm having trouble building an sql that returns the sum of the entries and the sum of the outputs correctly. I have tables tbl_produtos(id_produto,NomeProduto) , tbl_entradas_produtos(Id_produto,QuantProdutos,Estoque,ExcluirProdutoEnt)...
asked by 02.08.2016 / 18:14
0
answers

Syntax error: missing 'integer' when creating stored procedure in MySQL

When trying to create the stored procedure below, I get the title error in line containing: kill nID; What I'm doing wrong: DELIMITER // DROP PROCEDURE IF EXISTS ClearDB// CREATE PROCEDURE ClearDB() BEGIN DECLARE nID, bCursor int; DECLARE c...
asked by 21.06.2016 / 15:35