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
Can one drop a column from a table?
explain databases and sql server databases architecture? : Sql server database administration
you have developed an application which uses many stored procedures and triggers to update various tables users ocassionally get locking problems which tool is best suited to help you diagnose the problem? : Sql server administration
What is a user-defined function in the sql server and what is its advantage?
What is efficiency data?
What are the various editions of sql server 2017 that are available in the market?
What are page splits? : SQL Server Architecture
What is a non equi join?
hi, the following are the outputs of sp_spaceused and sp_tempdbspace sp_spaceused ------------ database size unallocated size tempdb 77752.95 MB 28026.99 MB sp_tempdbspace ------------- database size spaceused tempdb 77752.945312 1.007812 the unused space in sp_spaceused is nearly 28 Gb and in sp_tempdbspace is nearly 76 Gb cany any one explain about this output and why its giving different results.
How do I save a stored procedure in sql server?
What are the restrictions that views have to follow? : SQL Server Architecture
Show Practically Sql Server Views are updatable?
What is the difference between Clustered and Non-Clustered Index?
Explain hostprotectionattribute in sql server 2005?
What are the encryption mechanisms in sql server?