Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

You can establish predetermined values for a column when using the select statement by using the "CASE" statement:

SELECT column1, column2, CASE WHEN column3 >= 10 THEN 'High' WHEN column3 >= 5 THEN 'Medium' ELSE 'Low' END AS 'Priority' FROM table_name;

In this example, the values in column3 are evaluated and a new column (Priority) is created with predetermined values based on the criteria in the CASE statement.