title: Setting a variable with select inside coalesce
body: <p>How do I fix up this part of my stored procedure?</p>
  
  <p>The select will either return 1, 0, or null. If the select returns 1 or 0, I want @override to be set to that value. If it returns null, then I want @override to be set to 1. </p>
  
  <p>Something is wrong with my syntax; I am told "incorrect syntax near 'select'" and "incorrect sytax near ')'".</p>
  
  <p>Here is the sql:</p>
  
  <pre><code>set @override = (coalesce(select override from groupPreferences g inner join
  preferences p on g.preferenceId = p.preferenceId where groupId = 13
  and description = 'myDescription'), 1))
  </code></pre>