Results 1 to 14 of 14
Oct 14, 2012, 23:38 #1
- Join Date
- Dec 2009
- 0 Post(s)
- 0 Thread(s)
how to write a select query with condition ?
I want to pick students based on user input to a select query.
if input = -1 which means all students .. then I want to select all students
if input = studentId then I want to select that specific student only.
my problem is , How do I feed these conditions into where clause of the select query ?
As far as I know I can not use IF ELSE in where clause. What is the way to select students based on conditions ?
What should be the structure of the query ?