Pages

How to use PL/SQL Decode?

DECODE(expression, searchedValue, returnValues ...) function is used to search a value in a column or expression as it is done in IF-ELSE statements.


SELECT id, DECODE(id, 1, 'First row', 2, 'Second row') FROM students;