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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

multitable SQL query 1

Status
Not open for further replies.

skotman

ISP
Sep 11, 2003
328
US
This isn't urgent, just me being curious and for future reference.

Is there a way to grab records from multiple tables?

example:

Table1
ID
ParentName
Address
Phone number

Table2
ID
ParentID (from table 1)
KidName

I want to display the ParentName and KidName with out having to query the database twice.

I would have thought that Select Table1.ParentName, Table2.KidName from Table1, Table2 where ParentName = "Joe" would work but it doesnt. I can't find anything on this on the web.

Thanks in advance. I'm just trying to further my SQL knowledge.
 
peforming JOIN's on the tables is your usual method.

the SQL forums may be better to ask SQL question for future reference forum183 in particular

_____________________________________________________________________
onpnt2.gif

Hakuna matata!!
 
[smile]

_____________________________________________________________________
onpnt2.gif

Hakuna matata!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top