what is the out put of below queries?
a. select * from Emp where null = null;
b. select * from Emp where 1=1;

Answer Posted / sailaja

Hi,

select * from EMP where null=null;
->null=null is always false so it gives 0 records.
if it is null is null then it fetches all the records in a
table..

select * from EMP where 1=1;
->it fetches all the records in a table
if it is select * from EMP where 1=2;
-->it fetches 0 records..

Is This Answer Correct ?    1 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

how will add additional conditions in sql?

576


How to find the list of fixed hard drive and free space on server?

575


What is sharding?

88


why would you call update statistics? : Sql server database administration

577


What is cube dimension? : sql server analysis services, ssas

539






Explain various data region available in ssrs with their use?

494


how can u get last observation in an unknown dataset ?

2003


How can we rewrite sub-queries into simple select statements or with joins?

530


explain different types of cursors? : Sql server database administration

566


What are the types of joins in sql?

563


Why use “pivot” in sql server?

629


How to delete duplicate rows?

557


What are drillthrough reports?

102


Does a server store data?

504


In one interview...interviewer ask me question pleas tell me sql server architecture.. can any body tell me the sql server architecture with digram

1518