giovedì 13 marzo 2008

CASE - WHEN in SQL

Ho scoperto questo operatore che non avevo ancora incontrato:
select name,
CASE type
WHEN 1 THEN 'private customer'
WHEN 2 THEN 'public customer'
WHEN 3 THEN 'reseller'
ELSE 'unknown'
END
from Agenda

Nessun commento: