What is the difference between two queries:
1. SELECT * FROM table WHERE 1=1;
2. SELECT * FROM table

Answer Posted / pavan

hey! I too agree there wont be any difference in result it
displays but the performance will be different. While
executing the first query the where condition to be checked
for each record it displays hence it takes much time to
execute while compared with question no 2 i.e, without
where condition. this is what I believe in.

Is This Answer Correct ?    14 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the main purpose of having conversation group?

498


what is a join? : Sql server database administration

546


Can a table have 2 primary keys?

507


as a part of your job, what are the dbcc commands that you commonly use for database maintenance? : Sql server database administration

494


What is subquery explain with example?

613






define and explain the differences between clustered and non-clustered indexes.

601


do views contain data ?

588


Which tcl commands are available on the sql server?

607


Explain the dbcc pintable command when would you use it?

509


Which table keeps the locking information?

528


Where to find ntwdblib.dll version 2000.80.194.0?

558


Is there any difference between primary key and unique with the not null condition?

529


How do I view a stored procedure in sql server query?

540


What happens if you are trying to access a schema not owned by you?

512


Explain full-text query in sql server?

539