Questions tagged as 'where'

2
answers

SQL Select Where

Personal help please, I need to make a select in a table that contains ID, VALUE, DATE, NAME. The result has to bring only the lines where the date was the largest one. Example: ID VALOR DATA NOME 1 100 22/05/2...
asked by 22.05.2016 / 19:37
1
answer

Query 2 tables in a sql database and display repeated values [closed]

I have 2 tables in my database, one call pessoas and another call resultado , I am filling the result table with the draws made by mega sena, the result table has the fields: data, dez1, dez2, dez3, dez4, dez5, dez6 The people...
asked by 10.10.2017 / 05:23
1
answer

MySQL, use sum quantity (total) 10 in WHERE

I have the following MYSQL query: SELECT SUM(A.val) AS totalvendas, B.cod AS codigo, B.nom AS Nome, B.reg AS regiao FROM venda AS A LEFT JOIN vendedor AS B ON A.ven = B.cod WHERE reg = "norte" GROUP BY A.ven ORDER BY totalvendas DESC; It...
asked by 19.05.2017 / 06:21
1
answer

Select Union same table

Could anyone help me with this problem? The following query throws the following error:    # 1054 - Unknown column 'u.idocorrence' in 'where clause' SELECT DISTINCT * FROM( (SELECT o.*, u.nome AS requerente FROM ocorrencia o, util...
asked by 28.02.2016 / 00:34
0
answers

How to resolve the error Notice: Trying to get a non-object property of a select with WHERE

I'm trying to display a list of subscriptions for a particular user. The getuser() method captures the id of the session user and displays the list of entries created by it. However, I'm trying to display these records on screen, while...
asked by 18.11.2018 / 22:23
1
answer

filter between two dates with join

I have two tables: col (contributor) and Indicacao . I made select to know how many leads each employee has. It is working but I can not filter by date using between . SELECT c.id, c.nome, funcao, area, count(p.cpf...
asked by 22.09.2018 / 02:45
2
answers

Select / Where with paramerto does not work in Oracle

I'm doing a select with where via PHP and Oracle, when you get an error with the parameter:    Warning: oci_execute (): ORA-00911: invalid character in C: \ xampp \ htdocs \ project \ includes \ Read.php on line 52   Warning: oci_fetch_array...
asked by 13.04.2018 / 15:03
1
answer

How to use the Where in the consultation in laravel

How can I make a query below with mysql in laravel: SELECT gps.positions.id, gps.positions.protocol, gps.positions.deviceid, gps.positions.servertime, gps.positions.devicetime, gps.positions.fixtime, gps.positions.v...
asked by 21.03.2018 / 17:46
0
answers

Query in Laravel using SQL tags Like, where, and, or

Good afternoon guys, I'm having a problem because I need to make the following query representation in laravel SELECT * FROM imovels AS i INNER JOIN estados AS e ON e.id = i.estado_id INNER JOIN cidades AS c ON c.id = i.cidade_id...
asked by 12.08.2016 / 17:13
1
answer

How to select a table row and display information in another table relative to the table?

I am using this code but I am not able to interconnect them as it should be ... I wanted to register Payments (payments) so these only appear when you have to select the partner in the (partner) table ... String sql = "SELECT socio.*,...
asked by 01.07.2016 / 02:28