详细的见: http://www.psoug.org/reference/decode_case.html
SELECT DECODE (value,<if this value>,<return this value>,
< if this value>,<return this value>,
....)
FROM dual;
SELECT program_id,
DECODE(customer_id,
'AAL', 'American Airlines',
'ILC', 'Intl. Leasing Corp.',
'NWO', 'Northwest Orient',
'SAL', 'Southwest Airlines',
'SWA', 'Sweptwing Airlines',
'USAF', 'U.S. Air Force') AIRLINE,
delivered_date
FROM airplanes
WHERE ROWNUM < 11;
posted on 2009-02-20 16:04
donnie 阅读(85)
评论(0) 编辑 收藏 所属分类:
database