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