title: ALTER TABLE WHERE Clause
body: <p>I am not well versed with DDL. I was under the assumption that they was a <code>WHERE</code> Clause for <code>ALTER</code> and I have understood now after some research  that <code>WHERE</code> Clause doesn't exist for <code>ALTER</code> Command. How to handle cases where we might need to check some conditions in the <code>ALTER</code> Command?</p>
  
  <p><a href="https://stackoverflow.com/questions/26331778/mysql-drop-column-where-all-row-value-is-null/26331889#26331917">Mysql Drop column where all row value is null</a></p>
  
  <p>For example, for the above question, If I want to write something like the code below How do I do it?</p>
  
  <pre><code>ALTER TABLE my_table DROP col
  WHERE NOT EXISTS (SELECT * FROM my_table
                      WHERE col IS NOT NULL)
  </code></pre>
  
  <p>Is there any standard SQL way to achieve this? If not can anyone provide ways to do it for the various databases (SQL Server, MySQL, Oracle, PostgreSQL)?</p>