詳細的見: 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 閱讀(89)
評論(0) 編輯 收藏 所屬分類:
database