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

Joins in SQL

Status
Not open for further replies.

Overflow

Computer
Joined
Aug 1, 2000
Messages
1
Location
MT
I have a table, which contains several fields, which can have a value of 1,2,3 or 4.&nbsp;&nbsp;I have created another table which has the entries. <br><br>1 Large<br>2 Medium<br>3 Small<br>4 None<br><br>I would like to construct a query which searches the first table, but instead of outputing 1,2,3 or 4, Large, Medium, Small are outputted.. how can I do this?<br>
 
For a simple example, say TblA has ColA and ColB.&nbsp;&nbsp;ColB is the field with 1, 2, 3, or 4.&nbsp;&nbsp;Then TblC has ColC and ColD, where ColC is 1, 2, 3, or 4, and ColD is Large, Medium, Small, and None.<br><br>Then construct your query like this:<br><br>Select ColA, ColD<br>From TblA, TblB<br>Where TblA.ColB = TblC.ColC<br><br>For multiple columns in TblA with the same values, it becomes more difficult.&nbsp;&nbsp;To make it easy on myself, I do multiple queries, or have multiple tables but I know that is not really the most efficient use of computer memory.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top