handle0 2011-03-18
SELECT col1, col2, CASE WHEN col3 > 1 AND col3 <2 THEN '1' WHEN col3 > 2 AND col3 <3 THEN '2' WHEN col3 > 3 AND col3 <4 THEN '3' ELSE '4' END mylevel FROM table1 select case when nsrsbh='330165737758262' then nsrsbh when nsrsbh='330106745808709' then nsrsbh else '99999' end from WS_TDS_SQ decode(条件,值1,返回值1,值2,返回值2,...值n,返回值n,缺省值) decode(字段或字段的运算,值1,值2,值3) ELECT DECODE (value, <if this value>, <return this value>) FROM table select decode(nsrsbh,'330165737758262',nsrsbh,'330106745808709',nsrsbh,0) from WS_TDS_SQ select decode(nsrsbh,'330165737758262','6','9') from WS_TDS_SQ