Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 SQL Subquery confusion

Author  Topic 

martinfamily2005
Starting Member

2 Posts

Posted - 2010-09-07 : 17:05:35
Here is what I am trying to do. I am close, but I just can not get it...a bit confused since the data is in 3 separate tables. I uploaded the database here: http://www.filefactory.com/file/b3474b4/n/instnwnd.sql

Write a subquery that shows all of the products (ProductName) that were shipped via the same method as OrderID 10248

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2010-09-07 : 17:22:23
I don't like downloading people's scripts from the Internet. Could you instead put the queries directly in a post here?

Show us sample data for the three tables and the expected output using that sample data.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

martinfamily2005
Starting Member

2 Posts

Posted - 2010-09-07 : 21:47:32
The query is the problem I am having...I can not write it correctly to get the results I need. That "script" is the database I am using. IT will be kind of hard to describe all the data, etc in the entire database in a post.

Website: www.billboardfamily.com
Twitter: www.twitter.com/billboardfamily
Facebook Fan Page: www.facebook.com/BillboardFamily
Facebook (Carl): www.facebook.com/CarlMartin.BillboardFamily
Go to Top of Page

Lamprey
Master Smack Fu Yak Hacker

4614 Posts

Posted - 2010-09-08 : 11:22:50
The people that help out here are all un-paid volunteers. Providing the DDL (CREATE TABLE, CREATE INDEX, etc.), DML (INSERT statements) and Expected Output will go a long way in getting people to look at your issue and help you out. That way we can run our code against your data and the benefit to you is you get working code back. It's also a good idea to include code for what you have already tried.

This link can help your prepare your question including DDL and DML:
http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx
Go to Top of Page
   

- Advertisement -