Обсуждение: select case problem

Поиск
Список
Период
Сортировка

select case problem

От
Joseph Syjuco
Дата:
i have a table with the fields empno (not null) and division_no (null
allowed) what i wanted to do is to do a select case statement such that
when division_no is null itll output 'No division' if its not null itll
output 'with division' unfortunately this statement doesnt work ... i
need help on the correct syntax

select case division_no when null then 'no division' else 'with
division' end from employee;





Re: select case problem

От
"Matteo Beccati"
Дата:
Hi,

select case when division_no is null then 'no division' else 'with
division' end from employee;

Is the right syntax

Regards
--
Matteo Beccati
http://www.phpadsnew.com
http://phppgads.sourceforge.net