Find jobs | Company-wise jobs
Jobseekers | Employer login
About us Sitemap of www.CareerRide.com Sitemap FAQ related with www.CareerRide.com FAQ Click here to Contact us Contact
       
Submit Resume Free ! | Access Resume Free !
Home Interview Q&A Tutorials .NET Java Soft skills CV GD Work from home IT practice test MBA practice test FAQs in PDF Books Jobs FAQs
Interview questions                                 
SQL Server part 1
SQL Server part 2
SQL Server part 3
SQL Server part 4
SQL Server part 5
SQL Server part 6
SQL Server part 7
SQL Server part 8
SQL Server part 9
SQL Server 2008
Test your SQL Server skills!
Sql Server database maintenance
SQL Server backup
SQL Server cursor
SQL Server replication
Structured query language
SQL Server architecture
SQL Server constraints
SQL Server cursors
Data Mining
Data warehousing
SQL Server DTS
SQL Server functions
SQL Server indexes
SQL Server joins
SQL Server locks
SQL Server Net integration
SQL Server optimization
SQL Server replication
SQL reporting services
SQL service broker
SQL Server stored procedures
SQL Server table
SQL Server transactions
SQL Server transactions Architecture
SQL Server triggers
SQL Server views
SQL Server XML integration
SQL Server DDL
SQL Server DML
SQL Server DCL
SQL Server identifier
SQL Server data integrity
SQL Server accessing data
SQL Server subqueries
SQL Server cube operator
SQL Server insert data
SQL Server distributed queries
SQL Server index tuning
 

Subqueries with Exists and NOT Exists

<<Previous   Next>>

Sql server - Subqueries with Exists and NOT Exists - Nov 20, 2008 at 18:00 PM by Rajmeet Ghai

Explain with examples for the Subqueries with Exists and NOT Exists. 

A subquery with Exist does not really return any data; it returns TRUE or FALSE.

Example: This select statement will return all records from the sales table where there is at least one record in the orders table with the same sales _id.

SELECT * FROM sales WHERE EXISTS (select * from orders where sales.sales_id = orders.sales_id);

Example for NOT EXIST: This query will work exactly the opposite to above. I.e except for the sane sales_id all other records will be returned

SELECT * FROM sales WHERE NOT EXISTS (select * from orders where sales.sales_id = orders.sales_id); < P >      

<<Previous   Next>>
 

 

 
Want to be hunted by potential employers? Just submit your key skills!

Popular FAQs

.NET .Net Architecture ADO.NET Java Oracle C#.NET
VB.NET DOT.NET AJAX ASP.NET NET Framework OOPS in .NET
C++ Sql Server Data warehousing EJB MySQL Linux
PHP UML Networking Testing XML  
 
Copyright © 2008 - 2010 CareerRide.com. All rights reserved.