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

inner join query

Status
Not open for further replies.

danarashad

Programmer
Nov 2, 2006
115
US
can you do an inner join and use and or statement.
example
SELECT distinct table1.colors, table1.colors2, table2.rec_ID, table2.keyName, table2.form_id, table2.teacherID as sid, table2.teacherStatus, table2.teacherStatus, table2.appraiserStatus, table2.appraiserStatus, table2.cycleYear as ty, table2.cycle as tdc, table2.saved, table2.status
FROM table2 INNER JOIN table1 ON table2.status = table1.colors or table2.status=table1.colors2 where teacherStatus = 2 and appraiserStatus = 1 and teacherID=#ID#

how do i group the or clauses together
(table2.status = table1.colors or table2.status=table1.colors2)
Is that correct.
thanks in advanced.
 
You may also try this:
FROM table2 INNER JOIN table1 ON table2.status IN (table1.colors,table1.colors2)

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top