Questions tagged as 'where'

3
answers

Select with WHERE condition with multiple values in the same column

I have two tables in my bank and I do the JOIN with them. One table is a list of people and the other list that person's characteristics. By logic there is only one person and each person can have several characteristics, so two tables. So when...
asked by 01.05.2018 / 17:02
1
answer

Can I change more than one record at a time?

This is the code: UPDATE PESSOAS SET COR = ('Pardo') WHERE ID = 1; But I have 2 more records to do the same procedure, would you do it all at once by adding ID ?     
asked by 27.10.2017 / 19:55
2
answers

Condition in join or in where?

Is there a difference if I use: select * from a left join b on a.id = b.id and b.id2=1 where ... or select * from a left join b on a.id = b.id where b.id2=1 Sent on: Fri ? The first SQL returned me super fast, the second one did...
asked by 30.08.2016 / 13:52
3
answers

Problems with SELECT with 2 WHEREs

I have a somewhat amateurish problem here. I can not do this SELECT from 2 CONDITIONS, and I can not find the ERROR! Someone please give me a light there! Follow the Code: OleDbConnection Con = new OleDbConnection(); Con.ConnectionSt...
asked by 26.07.2016 / 22:53
3
answers

Performance "where in foreach vs if"

Which of the cases would perform best? var chaves = new list<string>(); foreach(var item in lista) { if(!string.IsNullOrEmpty(item.Chave)) { chaves.Add(item.Chave); } } Or listaValida = lista.Where(x => !string.IsN...
asked by 13.04.2017 / 17:13
3
answers

Select Where IN all records

Sirs, I've been looking for days to answer this question, which I think is silly, but I could not. I created a view that brings registration | Name | Title | Turn | About Us | CodTreina | Status I made this select: SELECT * FROM vw_tr...
asked by 08.05.2017 / 20:28
1
answer

Where Mysql search for complete word

I have a database and would like to know how do I search for the data by typing the complete result using where Example: ID NOME CODIGOS 1 | Joao | 9714,51,100 2 | Maria | 50,9714,88100 I wanted to make it return a where by search...
asked by 29.04.2018 / 18:27
1
answer

Difference between INNER JOIN, JOIN and WHERE? [duplicate]

I need to make a query that returns information according to a given condition, I've always used Where because I did not know if I could use another method. So what's the difference between Where , Inner Join and...
asked by 20.10.2017 / 17:40
3
answers

Select value other than "X" name

How do I select only the different ratings of "X" in a given column? I created the select below: SELECT top 1000* FROM [tabela_clientes] WITH (NOLOCK) WHERE STATUS= 'pendente' and status_2= 'pagamento' and REGIAO= 'sao paulo' --------...
asked by 04.06.2018 / 22:28
1
answer

column does not obey the where statement of an update

I have a problem. At the moment I do an update, when I use the where only the line with the informed code is updated. but the description field that I inform, its contents is replicated for all the lines of the bank this is the only column that...
asked by 09.06.2016 / 16:29