title: Case statement inside create-table
body: <p>How do you use the "java if-statement" in SQL => PostgreSQL, while creating a table/Column?</p>
  
  <pre><code>    CREATE TABLE Store(
             Discount INT 
                  AS CASE 
           WHEN SOLD_Amount&gt;100000 THEN 2
           WHEN SOLD_Amount&gt;500000 THEN 5
           WHEN SOLD_Amount&gt;1000000 THEN 10
           ELSE 0
       END       
             NOT NULL)
  </code></pre>
  
  <p>This is probally wrong, please tell us, the community how to do this kind of action.</p>