tags:

views:

22

answers:

2

i trying to fetch records from database as.

select * from emp_marks where sub_id all(2,4);
+1  A: 

you can't use all with where clause, if you want to get all the records that have sub_id = 2 or 4 you can use:

select * from emp_marks where sub_id in (2,4)
Wael Dalloul
A: 

If you want the records where sub_id is either 2 or 4, you need

SELECT * FROM emp_marks WHERE sub_id IN (2,4);

if you want to records where sub_id is both 2 and 4, you don't have to perform query at all ;-)

Michael Krelin - hacker