wichtig: IF das ungleich das DANN JOIN, sonst weise wert zu - möglich?

Beitrag lesen

Hallo.

SELECT fid, user, themainfile, used, whatisit, whoused, whogive  
  
FROM thefiles  
  
JOIN profile ON profile.id=thefiles.whoused  
  
WHERE  
whatisit='".intval($shopsid)."' AND tid='".intval($_SESSION['teamid'])."' 

So der JOIN soll nur stattfinden wenn thefiles.whoused!='9999'. Falls thefiles.whoused='9999', dann soll user='niemand' sein.

Ist das irgendwie möglich?
Versuch war:

IF(thefiles.whoused!='9999',(JOIN profile ON profile.id=thefiles.whoused),(user='niemand') )

aber das klappt irgendwie nicht :(

Helft mir.

Gruss,

Wichtig