+ 1
Can we give 2 or more conditions by using where?
13 odpowiedzi
+ 3
Yes you can!
SELECT * FROM users WHERE Id > 100 AND Name = 'James'
+ 3
Yes
for example.
select *
from Nepal
where location = 'Katmandu' and salary > 10000 and last_name = 'Ghimire' ;
+ 3
Absolutely! You just have to join your conditions using the AND keyword if you want them all to be true or the OR keyword if just one of them needs to be true.
Examples:
SELECT * FROM students
WHERE state='New York' AND age>16
this will give a list of all students older than 16 that are from New York
SELECT * FROM students
WHERE state='New York' OR age>16
This will give a list of all students either from New York or older than 16.
+ 3
You can use AND , OR operators between the conditions according to your requirement.
SELECT * FROM TableName
WHERE CONDITION1 AND CONDITION2
SELECT * FROM TableName
WHERE CONDITION1 OR CONDITION2
Likewise you can join two or more conditions. You can use AND and OR at the same time.
SELECT * FROM TableName
WHERE (CONDITION1 or CONDITION2) and CONDITION3
+ 3
Yes , you can use as many time as you want but you need to use boolean operators like AND , OR , NOT
+ 1
yes,why not
SELECT * FROM TableName
WHERE ColumnName1=Value1 AND(also you can use OR) ColumnName2=Value2 AND(OR)...
+ 1
yes.. using connectives AND or OR
syntax:
select column_names_list
from table_names
where condition1 AND (/OR) condition2
0
select ename from emp
where ename= 'SMITH' and ename='KING';
this is a proper example to use 2 conditions
0
yes
0
yes
- 3
select name,id from emp where id =101 or name=any other row name;
- 3
how can use joint table
- 6
no