×ðÁú¿­Ê±

inÔÚsqlÖеÄÒâ˼

in ²Ù×÷·û¼ì²éij¸öÖµÊÇ·ñ°üÀ¨ÔÚÖ¸¶¨µÄÖµÁбíÖУ¬Ó﷨Ϊ£ºselect * from table_name where column_name in (value1, value2, …, valuen)¡£ËüµÄÓŵãÊÇÌá¸ßÅÌÎÊÐÔÄÜ£¬ÌØÊâÊǵ±ÐèÒª¼ì²éÒ»¸öÖµÊÇ·ñ°üÀ¨ÔÚ´ó×ÚÖµÖÐʱ¡£±ðµÄ£¬in ²Ù×÷·û»¹¿ÉÓë×ÓÅÌÎÊ»ò not ÔËËã·ûÒ»ÆðʹÓá£

IN ²Ù×÷·ûÔÚ SQL ÖеļÄÒå

IN ²Ù×÷·ûÔÚ SQL ÖÐÓÃÓÚ¼ì²éij¸öÖµÊÇ·ñ°üÀ¨ÔÚÖ¸¶¨µÄÒ»×éÖµÖС£ËüʹÓÃÒÔÏÂÓï·¨£º

SELECT * FROM table_name WHERE column_name IN (value1, value2, ..., valueN);

µÇ¼ºó¸´ÖÆ

ÆäÖУº

table_name ÊÇÒª´ÓÖмìË÷Êý¾ÝµÄ±í¡£

column_name ÊÇÒª¼ì²éÖµµÄÁС£

value1, value2, …, valueN ÊÇÒª¼ì²éµÄÖµÁбí¡£

ÔõÑùʹÓà IN ²Ù×÷·û

ҪʹÓà IN ²Ù×÷·û£¬Ö»Ð轫Ҫ¼ì²éµÄÖµ·ÅÔÚÀ¨ºÅÄÚ¡£ÀýÈ磬ҪÕÒ³ö±í customers ÖÐÆÜÉíÔÚŦԼ»ò¼ÓÖݵĿͻ§£¬¿ÉÒÔ±àдÒÔÏÂÅÌÎÊ£º

SELECT * FROM customers WHERE state IN ('NY', 'CA');

µÇ¼ºó¸´ÖÆ

IN ²Ù×÷·ûµÄÓŵã

ʹÓà IN ²Ù×÷·ûµÄÖ÷ÒªÓŵãÊÇËü¿ÉÒÔÌá¸ßÅÌÎÊÐÔÄÜ¡£µ±ÐèÒª¼ì²éÒ»¸öÖµÊÇ·ñ°üÀ¨ÔÚ´ó×ÚÖµÖÐʱ£¬Ê¹Óà IN ²Ù×÷·û±ÈʹÓöà¸ö OR Ìõ¼þ¸üÓÐÓá£

ÆäËûÏà¹ØÐÅÏ¢

IN ²Ù×÷·û»¹¿ÉÒÔÓë×ÓÅÌÎÊÒ»ÆðʹÓã¬ÓÃÓÚ¼ì²éij¸öÖµÊÇ·ñ°üÀ¨ÔÚ´ÓÁíÒ»¸öÅÌÎÊ·µ»ØµÄЧ¹û¼¯ÖС£

IN ²Ù×÷·û»¹¿ÉÒÔÓë NOTÔËËã·ûÒ»ÆðʹÓã¬ÒÔ¼ì²éij¸öÖµÊÇ·ñ²»°üÀ¨ÔÚÖ¸¶¨µÄÖµÁбíÖС£

ÒÔÉϾÍÊÇinÔÚsqlÖеÄÒâ˼µÄÏêϸÄÚÈÝ£¬¸ü¶àÇë¹Ø×¢±¾ÍøÄÚÆäËüÏà¹ØÎÄÕ£¡

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

Ïà¹ØÐÂÎÅ

ÁªÏµ×ðÁú¿­Ê±

18523999891

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

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

QR code
¡¾ÍøÕ¾µØͼ¡¿¡¾sitemap¡¿