Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
AskSQLTeam
Ask SQLTeam Question
0 Posts |
Posted - 2005-06-27 : 08:29:59
|
Prathiba writes "Why do we use WHERE 1 = 1 in the queries?" |
|
Arnold Fribble
Yak-finder General
1961 Posts |
Posted - 2005-06-27 : 08:36:19
|
Because we're generating the SQL and we're too lazy to write a special case for the first condition not having an AND in front of it? |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2005-06-27 : 09:03:27
|
YesIt is equivalent to Select columns from tableTo get only structure and not data Select Columns from table where 1=0MadhivananFailing to plan is Planning to fail |
|
|
|
|
|