title: SQL IF SELECT query is null then do another query
body: <p>I have a query that regularly returns "nothing", and I would like to run a different query if this is the case, but I know not of the way of doing this. If anyone could be of help please.</p>
  
  <p>Here is the current code I am using...</p>
  
  <p><code>SELECT * FROM  cfg_users JOIN cfg_ash ON cfg_users.iUserId = cfg_ash.iUserid WHERE iTeamId</code>=<code>'0' AND sDisabled IS NULL AND iStatusId &gt; 0 AND sDate = '2014-08-01' GROUP BY cfg_users.iUserId</code> <code>ORDER BY iStatusId, sName</code></p>
  
  <p>I basically want to say</p>
  
  <pre><code>IF &lt;my code&gt; IS NULL THEN &lt;do other code&gt;, IF &lt;my code&gt; IS NOT NULL THEN return the result.
  </code></pre>
  
  <p>Thanks</p>