4
Is there any way in SQL I get all the data except an ID?
For example (I know this does not exist in SQL)
Select * From Utilizadores Where id_ut != 1;
4
Is there any way in SQL I get all the data except an ID?
For example (I know this does not exist in SQL)
Select * From Utilizadores Where id_ut != 1;
11
Besides the way you’ve already asked your question, not equal to ( != ), can do in other ways:
Using the other than:
Select * From Utilizadores Where id_ut <> 1;
Using the not in:
Select * From Utilizadores Where id_ut not in (1);
/*Usando o not in, você pode passar uma lista de valores (1,2,10)*/
Remembering that you can use these 3 operators ( <>
, !=
, not in
) not only with numerical values, but with texts as well.
For example:
Select * From Utilizadores Where nome_ut not in ('João', 'Pedro', 'Maria');
Select * From Utilizadores Where nome_ut <> 'João';
Select * From Utilizadores Where nome_ut != 'João';
1
Hey, do it like this:
Select * From Utilizadores Where id_ut <> 1;
Roger, can you explain why this line of code solves the problem? So it helps to understand the problem and the answer to those who don’t know what <>
means. Thank you!
Browser other questions tagged sql
You are not signed in. Login or sign up in order to post.
There is the different
<> ou !=
, hasnot
sometimes accompanied by thein
, which bank is using?– rray
I wanted to understand why using the != did not solve your problem. You asked a question with the solution already...
– Giovanni Machado