Questions tagged as 'where'

2
answers

Passing values from a select to subselect

I have the following query: SELECT rp.colaborador as codigo_, t.nome, count(rp.*) as presencas, ((100 * (select count(rp.*) from empresa.cad_reuniao_presencas rp join empresa.cad_terceiros t on t.codigo = rp.colaborador join emp...
asked by 21.05.2015 / 18:51
1
answer

Select with LIKE with argument%

I'm trying to make a select, using LIKE and setting the argument%:    WHERE title LIKE '% computer%' finds all book titles with the word 'computer' anywhere in the book title. source: link However, when I run the direct comman...
asked by 14.08.2016 / 16:02
1
answer

Error Code: 1054. Unkowm column

I want to query a value from an account I made in SQL: (Valor - (select Visibilidade)) AS Diferenca When I try to query: Diferenca <= 500 It displays the following error: Error Code: 1054. Unknown 'Diferenca' in 'w...
asked by 19.09.2017 / 20:37
1
answer

Count records only if greater than the current datetime, with count ()

I have the following query : SELECT u.nome, u.email, u.login, u.data_cadastro, COUNT(*) AS qtd FROM patrocinadores AS p LEFT JOIN anuncios AS a ON a.id_user = p.id_user INNER JOIN usuarios AS u ON u.id = p.id_user WHERE p.id_patrocinado...
asked by 05.12.2015 / 02:39
1
answer

Where in datatables with codeigniter

I have a code that draws a table according to the data in the database. EX: if she has a registered client she will make the table with only one row, if it has no one registered, no table will appear. In that code too, I have a filter (tabletool...
asked by 18.08.2015 / 14:36
1
answer

Check if any line of the Select result in Mysql contains a value

I would like to know how to check the where clause if any of the line has a certain number. For example: If a select returns 1 2 3 4 and in the request clause 4 it returns the values, if it returns 1 2 3 and in request clause 4 it retu...
asked by 16.04.2015 / 23:49
0
answers

Selet of all records of an IN clause in Mysql

I would like your help because I made a simple query that would need to return all the records specified in the IN clause. In this clause IN (TF.CodTreina IN) is coming from a select. The problem is that it is returning some employees who have s...
asked by 15.03.2017 / 14:58
1
answer

SQL select with dynamic where in ABAP

Is it possible to create a select with dynamic where in the abap language?     
asked by 13.12.2017 / 19:21
2
answers

INSERT INTO with filter in MySQL

I'm trying to create an INSERT INTO in an X table by making a filter in the Y table, but I get a syntax error. I researched what may be wrong, but not find out. INSERT INTO products ( SELECT * FROM products AS P WHERE P.FK_ID_QUOTE = 1...
asked by 27.11.2018 / 14:03
2
answers

Set of WHERE, AND, and OR Conditions in SQL does not produce the expected result

I'm trying to get some records with a very simple syntax, but it's not working. I'm doing something wrong and I'm not realizing it. Can someone lend a hand? I need to fetch all 2017 records except FREIGHT AND TAXES! I have this: SELECT * F...
asked by 30.06.2017 / 18:11