I have seen in some programmers use 1=0 in where condition for select query , why they use this condition.
in sql server, you can quickly create a copy of a table without any data like this
select * into Newtable
from Oldtable
where 1 = 0
this will create a new table with the same structure as the old table
Another option is to return an empty resultset
The only possible use for that would be to prevent the query from returning any rows. I've done it occasionally for testing "no results found" type logic.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With