title: How can I change the default value for certain rows in SQL?
body: <p>Fistly, I need to make all rows in a column called Mail_flag have a default of 'Y'. I did this already with the following line of code:</p>
  
  <pre><code>ALTER TABLE criminals
       MODIFY (Mail_flag DEFAULT 'Y');
  </code></pre>
  
  <p>Easy enough. But now, I need to make all rows that do NOT have a street address (where the column name is "street") have a default value of 'N'. I assumed the code would like something like the following: </p>
  
  <pre><code>ALTER TABLE criminals
       MODIFY (Mail_flag DEFAULT 'N')
       WHERE street = null;
  </code></pre>
  
  <p>However, I received an error message which said "Invalid Alter Table Option." I then tried an Update command, which also failed. Basically, I need two default values. One that is a 'Y', and one that is an 'N', only when a certain condition applies (the condition being that the street value is null). Please help! I've been struggling with this for 2 hours. </p>