0
How Select data with two parameter in same rows?
My query not working, My query : select name from student_exam where exam_id = 1 && exam_id= 2 group by name
9 Antworten
+ 1
IIRC 'AND' is used in SQL instead of '&&'.
Your condition doesn't make much sense, how can 'exam_id' value be 1 and 2 at the same time?
+ 1
Well, if you try to select something, which has to have two different values, where only one value can be, your result will always be empty.
+ 1
Probably LIKE '%1%' OR LIKE '%2%'... Would return every id which contains a 1 or 2. If it's a string...
0
Check the in-command. WHERE value IN ( a, b, c )
0
Like i used OR,
0
That's another possibility, but more to write. 😉 and less flexible.
0
But i need data have two value using [AND],
0
You want to select all exams with ID '1' or '2'. Right?
0
Id = 1 AND id = 2