I am working on a java code in which i am comparing the user input values with database values.
I am here writing to display the alert message to the users on selecting particular division from drop down menu. But there are some alert message which I want to display to all users of every division.
I have the table columns as
SELECT DECODE(DIV_CODE,'61','Division A',
FROM ALERTS WHERE ALERT_FLAG='Y';
If there is no match, then the result will be
'ALL'. I would strongly encourage you to use the ANSI-standard
CASE statement, instead of the Oracle-specific
SELECT (CASE DIV_CODE WHEN '61' THEN 'Division A' WHEN '62' THEN 'Division B' ELSE 'ALL' END) FROM ALERTS WHERE ALERT_FLAG = 'Y';