Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

"Where" condition in SQL statement

Status
Not open for further replies.

anandcv

Programmer
Oct 10, 2002
15
0
0
IN
In "WHERE" clause of SQL statement, if there are more than one conditions then why one of them is ..." 1 = 1"

for example
select * from student_info
WHERE 1 = 1
AND student_id = 10
AND STANDARD = '9th'
AND MARKS_OBTAINED >=90;


Thanks
Anand
 
This is not necessary for the statement to run. I have done this to allow for dynamic construction of statements, including manual cutting and pasting of conditions. Each clause can be built as an "AND" without the logic of determining if the (first) WHERE clause is present.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top