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!

help with query

Status
Not open for further replies.

NickMalloy

Programmer
Apr 15, 2005
68
US
I have three tables and want to combine them for a query

main
----
order_by
deptid
title
name
building

department
----------
deptid
deptname

building
--------
buildingid
buildingname

I want to grab everything in the main table, but I want to replace the deptid with the name that corespondes in deptname and do the same for building. Can someone help me with this?
 
try this:

SELECT A.order_by, B.deptname,A.title, A.name, C.buildingname FROM main A, department B,
building C WHERE
A.deptid=B.deptid AND A.building=C.buildingid

-DNG
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top