×ðÁú¿­Ê±¹ÙÍøµÇ¼

plsqlÖÐcase whenÓ÷¨

pl/sql ÖÐµÄ case when ÊÇÒ»ÖÖƾ֤Ìõ¼þÖ´Ðвî±ðÐж¯µÄÌõ¼þÓï¾ä¡£Óï·¨£ºcase when Ìõ¼þ then Ч¹û else ĬÈÏЧ¹û end;Óŵ㣺¸ü¾«Á·¡¢Ò׶Á£¬¿ÉÓÃǶÌס£ÏÞÖÆ£ºÖ»ÄÜ´¦Àí¼òµ¥ÖµÌõ¼þ£¬Ð§¹û±ØÐèÊǵ¥¸öÖµ¡£

PL/SQL ÖÐ CASE WHEN Ó÷¨

ʲôÊÇ CASE WHEN£¿

CASE WHEN ÊÇ PL/SQL ÖÐÒ»ÖÖÌõ¼þÓï¾ä£¬ÓÃÓÚƾָ֤¶¨µÄÌõ¼þÖ´Ðвî±ðµÄÐж¯¡£

Óï·¨

CASE
  WHEN Ìõ¼þ1 THEN Ч¹û1
  WHEN Ìõ¼þ2 THEN Ч¹û2
  ...
  ELSE ĬÈÏЧ¹û
END;

µÇ¼ºó¸´ÖÆ

Ó÷¨

½ç˵Ìõ¼þ£ºWHEN ×Ó¾äÖ¸¶¨Òª¼ì²éµÄÌõ¼þ¡£

Ö¸¶¨Ð§¹û£ºTHEN ×Ó¾äÖ¸¶¨ÈôÊÇÌõ¼þΪÕæʱҪ·µ»ØµÄЧ¹û¡£

ÉèÖÃĬÈÏÖµ£ºELSE ×Ó¾äÖ¸¶¨ÈôÊÇËùÓÐÌõ¼þ¶¼²»Öª×ãʱҪ·µ»ØµÄЧ¹û¡£

ʾÀý

-- ½«Êý×Öת»»ÎªÔ·ÝÃû³Æ
CASE score
  WHEN 1 THEN 'January'
  WHEN 2 THEN 'February'
  WHEN 3 THEN 'March'
  ELSE 'Unknown'
END;

µÇ¼ºó¸´ÖÆ

Óŵã

¿ÉÓÃ×÷Ìæ»» IF-ELSEIF-ELSE Óï¾äµÄ¸ü¾«Á·¡¢Ò׶ÁµÄÒªÁì¡£

¿ÉÒÔǶÌ׶à¸ö CASE WHEN Óï¾ä£¬ÒÔ´¦Àí¸üÖØ´óµÄÌõ¼þ¡£

ÏÞÖÆ

Ö»ÄÜ´¦Àí¼òµ¥ÖµÌõ¼þ£¬²»¿ÉÓÃÓÚ´¦Àí¹æÄ£»òÁбí¡£

CASE WHEN Óï¾äµÄЧ¹û±ØÐèÊǵ¥¸öÖµ£¬²»¿ÉÊDZí»òÓαê¡£

ÒÔÉϾÍÊÇplsqlÖÐcase whenÓ÷¨µÄÏêϸÄÚÈÝ£¬¸ü¶àÇë¹Ø×¢±¾ÍøÄÚÆäËüÏà¹ØÎÄÕ£¡

ÃâÔð˵Ã÷£ºÒÔÉÏչʾÄÚÈÝȪԴÓÚÏàÖúýÌå¡¢ÆóÒµ»ú¹¹¡¢ÍøÓÑÌṩ»òÍøÂçÍøÂçÕûÀí£¬°æȨÕùÒéÓë±¾Õ¾Î޹أ¬ÎÄÕÂÉæ¼°¿´·¨Óë¿´·¨²»´ú±í×ðÁú¿­Ê±¹ÙÍøµÇ¼ÂËÓÍ»úÍø¹Ù·½Ì¬¶È£¬Çë¶ÁÕß½ö×ö²Î¿¼¡£±¾ÎĽӴýתÔØ£¬×ªÔØÇë˵Ã÷À´ÓÉ¡£ÈôÄúÒÔΪ±¾ÎÄÇÖÕ¼ÁËÄúµÄ°æȨÐÅÏ¢£¬»òÄú·¢Ã÷¸ÃÄÚÈÝÓÐÈκÎÉæ¼°ÓÐÎ¥¹«µÂ¡¢Ã°·¸Ö´·¨µÈÎ¥·¨ÐÅÏ¢£¬ÇëÄúÁ¬Ã¦ÁªÏµ×ðÁú¿­Ê±¹ÙÍøµÇ¼ʵʱÐÞÕý»òɾ³ý¡£

Ïà¹ØÐÂÎÅ

ÁªÏµ×ðÁú¿­Ê±¹ÙÍøµÇ¼

18523999891

¿É΢ÐÅÔÚÏß×Éѯ

ÊÂÇéʱ¼ä£ºÖÜÒ»ÖÁÖÜÎ壬9:30-18:30£¬½ÚãåÈÕÐÝÏ¢

QR code
ÍøÕ¾µØͼ