ΪʲôÎÒÕâ¸ö±¨´íÄØ£¿ select case when ... then ... else case when .... then .... else null end from ... ±¨Ê²Ã´´í else case when .... then Õâ¸öÀïÃæµÄcase½áÊøÊ±ÊÇ·ñ¼ÓÁËend
else ºóÃæ²»ÓÃÔÚ¼ÓcaseÁË.
Óï·¨ÊÇ: select case when ... then ... ... else null end from t 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