I have a table called tblStudent having data as
I want to retrieve records having single value compared against multiple columns. For example -
find all students having Grade 'C' in any of the subjects.
One way could be -
SELECT * FROM tblStudent
WHERE Grade_Maths = 'C' OR
Grade_Science = 'C' OR
Grade_English = 'C'
Another (cleaner/shorter) way of achieving same is
SELECT * FROM tblStudent
WHERE 'C' IN (Grade_Maths, Grade_Science, Grade_English)
Because the table data can be considerably huge in real-time, I am not sure whether second method will always return correct result. Can please suggest if there could be any potential issue with using second approach.
Thanks a lot!
