linux1880 Posted July 15, 2010 Share Posted July 15, 2010 hi friends I have seen lots of select queries with (where 1=1) for example "SELECT * FROM categories WHERE 1=1 " why use (where 1=1) when same can be achieved by "SELECT * FROM categories " Quote Link to comment Share on other sites More sharing options...
trq Posted July 15, 2010 Share Posted July 15, 2010 These are generally used when you might dynamically add AND clauses to there WHERE clause. It just depends on your logic for adding them. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.