Difference between >= and <= and between keyword in SQL serv
What is the difference between >= and <= and between keyword in SQL server.Please give an example.
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Iftikar HussainPosted Jul 10, 2013, 3:06 AM
Regards,
Iftikar
Ravi ShekharPosted Jul 10, 2013, 2:54 AM
Your example says that between is slower than <=,>=. am i right???
Iftikar HussainPosted Jul 4, 2013, 4:39 AM
'>=' and '<=' are much faster then between keyword. The between will filter rows after reading all the records where as >= and <= will check first the condition and pull the records. Please refer the below screen shot
using between
using >= and <=
Regards,
Iftikar
Jignesh TrivediPosted Jul 4, 2013, 4:18 AM
Between keyword perform > and < opration so start value and and value is not part of your query result while in >= and <=, start and end value may be a part of you query result.
Note: for Between you have write single time expression where as <= and >= you have to write expression mutliple time.
hope this will help you.
Sanjeeb LenkaPosted Jul 4, 2013, 1:20 AM
http://stackoverflow.com/questions/1960801/why-use-the-between-operator-when-we-can-do-without-it
http://stackoverflow.com/questions/921282/compare-performance-difference-of-t-sql-between-and-operator