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 help

Author  Topic 

vigneshprabu82
Starting Member

6 Posts

Posted - 2015-02-11 : 20:47:51
Customer Table
id firstname lastname
1 john p
2 rob s
3 dan y

Address Table
id effectivedate address city state zip
1 01/01/82 x y c u
2 02/10/97 y z y p

Order Table
id orderdate
1 10/10/2001
2 11/11/2005

Assuming ID and effectivedate are the primary keys, I want to pull first name, last name, most recent order date, and mailing address as-of 9/1/2010 for each of the customers listed in the customer table.

gbritton
Master Smack Fu Yak Hacker

2780 Posts

Posted - 2015-02-11 : 22:01:07
What have you got so far?
Go to Top of Page

vigneshprabu82
Starting Member

6 Posts

Posted - 2015-02-11 : 22:35:27
Im very new to sql and learning step by step. Since it will be a three table join, Im not sure how to join these tables.
Go to Top of Page

gbritton
Master Smack Fu Yak Hacker

2780 Posts

Posted - 2015-02-12 : 06:56:30
ok well think what you should do is read up on joins look at a lot of examples and then try to write your own. If you not getting what you want then come back here and post the query you've worked up and we can take a look at it and help finish it.
Go to Top of Page

vigneshprabu82
Starting Member

6 Posts

Posted - 2015-02-13 : 00:13:17
OKAY SMART A**
NOW GET ON TO YOUR WORK!
Go to Top of Page
   

- Advertisement -