Example: List all customers who have an order
By submitting your email address, you agree to receive emails regarding relevant topic offers from TechTarget and its partners. You can withdraw your consent at any time. Contact TechTarget at 275 Grove Street, Newton, MA.
Using Type I nested query: SELECT Cust_id, Cust_name FROM customer WHERE cust_id IN (SELECT cust_id FROM Order)
Using Inner Join: SELECT Cust_id, Cust_name FROM customer,order WHERE customer.cust_id = order.cust_id
Any information you can provide would be appreciated. Thanks.
Do you have comments on this Ask the Expert Q&A? Let us know.
Dig Deeper on Microsoft SQL Server Performance Monitoring and Tuning
Related Q&A from Jeremy Kadlec
Learn how to view a query execution plan in SQL Server with SQL Server Management Studio or Query Analyzer. Review and decrease query plan sub tree ...continue reading
Adding non-clustered indexes to SQL Server columns and tables frequently queried is possible. Learn how to add non-clustered indexes to SQL Server ...continue reading
Want to change the collation to SQL Server 2005 standards after upgrading databases from SQL Server 2000? Learn the best approach involving DTS and ...continue reading
Have a question for an expert?
Please add a title for your question
Get answers from a TechTarget expert on whatever's puzzling you.