Questions tagged as 'where'

0
answers

Query with sql does not return when using WHERE

I have a query that should bring the name of the users who received a message sent by a user: SELECT msg.msg_content ,usr.user_name FROM message AS msg INNER JOIN usuarios AS usr ON msg.user_id_out = usr.user_ssid WHERE usr.user_...
asked by 24.02.2016 / 17:26
0
answers

Bring user information in the model

I have a code that lists several reports. These reports are saved in the database and to call them I use the Model in CodeIgniter . Within the model, I have a where and to make it work perfectly, with the information I want, I need to...
asked by 12.11.2015 / 11:47
0
answers

bring data from the bank according to other data

I have a code that brings the database data and generates a table. This data is coming all that are registered, but I need only the data with the same user state to come. For example: I have a user from Santa Catarina, I need the data to co...
asked by 09.11.2015 / 12:42
0
answers

Inner Join + Where in MySQL

How to use INNER JOIN with WHERE ? I'm doing a INNER JOIN with 3 tables. I need a WHERE to return only one record. I'm trying this way: SELECT '*' FROM ('tabela1') INNER JOIN 'tabela2' ON 'tabela1'.'id' = 'tabela...
asked by 27.05.2015 / 20:09
2
answers

Repeat condition in WHERE at query time

I currently use WHERE coluna IN (1,2,3,4) in my query. Only I noticed that IN works as a sort of "OR", this gives me a small problem because ID are characteristics of a product. These features are selected from a menu, and I...
asked by 10.02.2017 / 23:03
1
answer

Query using WHERE

I need to query in a table called controls: I have the column CH which is the hourly load in minutes and I have the column SETOR which are the sectors that participated in some training. I need to make an appointment wh...
asked by 21.08.2018 / 15:37
1
answer

CONDITION WITHIN WHERE CLAUSE

Good afternoon!   I have a task to perform a select, but the parameters are passed as variables and I need to treat the input of one of these variables with the following logic: if & CT is not null, then I add in the condition of select the...
asked by 20.09.2018 / 18:55