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

I am having trouble with a Left Join / Case

Status
Not open for further replies.

snowboardr

Programmer
Feb 22, 2002
1,401
PH
Is it possible to do this?

Code:
SELECT 
files.aid, files.atitle, files.adesc, files.asize, files.aonline, files.adate, files.privemployee, files.privnotemployee, files.privuseprivs, 
privs.pid, privs.puid, privs.pfid, privs.priv1 FROM files
LEFT JOIN on 
CASE WHEN files.privuseprivs=1 THEN privs.pfid=files.aid 
CASE WHEN files.privemployee=1 THEN privs.puid=1 
CASE WHEN files.privnotemployee=1 THEN privs.puid=2 
ORDER by aid DESC Limit 0,20
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top