Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Query to get all Data in One Table, Matching of Another

Status
Not open for further replies.

DariceLR

MIS
Jun 20, 2001
27
0
0
US
... Thanks in advance...
I have two tables:
Member Table
(Primary Key: MemberID)
Fname
Mname
Lname
...

AddressTable
(Primary Key is MemberID and AddressType)
AddressType
Address
City
State
Zip
...


What I need is to get all the columns of table Member and if there is a matching child record in Address show it, otherwise just show the member data. I can only think of the way to join that gives me only the members that have address information, but I need all members, regardless if they have Address Information.

Can you help? ****************
DariceLR
:-{} :-V
****************
 
select * from member left outer join address
on member.memberid = address.memberid
 
SELECT m.fName, m.lName, a.address, a.city, a.state
FROM members m
LEFT JOIN address a ON m.memberID = a.memberID Get the Best Answers! faq333-2924
Is this an asp FAQ? faq333-3048

mikewolf@tst-us.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top