sqlÖÐwhereºóÔõô¼ÓÁ½¸öand
Êǵģ¬¿ÉÒÔÔÚ sql ÖÐµÄ where ×Ó¾äÖÐʹÓöà¸ö and Ìõ¼þ¡£ÕâÊÇÓï·¨£ºwhere condition1 and condition2 and … conditionn¡£Ã¿¸öÌõ¼þ½«½øÒ»²½É¸Ñ¡Êý¾Ý£¬Ö»·µ»Øͬʱ֪×ãËùÓÐÌõ¼þµÄÐС£
SQL ÖÐ where ºóÌí¼Ó¶à¸ö AND Ìõ¼þ
ÔÚ SQL ÖУ¬WHERE ×Ó¾äÓÃÓÚ¹ýÂ˱íÖеÄÊý¾Ý£¬·µ»ØÖª×ãÖ¸¶¨Ìõ¼þµÄÐС£ÒªÌí¼Ó¶à¸ö AND Ìõ¼þ£¬¿ÉÒÔʹÓÃÒÔÏÂÓï·¨£º
WHERE condition1 AND condition2 AND ... conditionN
µÇ¼ºó¸´ÖÆ
¾ÙÀý£º
¼ÙÉèÎÒÃÇÓÐÒ»ÕÅÃûΪ “customers” µÄ±í£¬ÆäÖаüÀ¨ÒÔÏÂÁУº
id
name
age
city
Òª²éÕÒËùÓÐ 25 ËêÒÔÉÏ£¬ÆÜÉíÔÚ “New York” ÊеĿͻ§£¬¿ÉÒÔʹÓÃÒÔÏÂÅÌÎÊ£º
SELECT * FROM customers WHERE age > 25 AND city = 'New York';
µÇ¼ºó¸´ÖÆ
ÔÚÕâ¸öÅÌÎÊÖУ¬ÎÒÃÇʹÓÃÁËÁ½¸ö AND Ìõ¼þ£º
age > 25£ºÉ¸Ñ¡³öÄêËê´óÓÚ 25 µÄ¿Í»§¡£
city = ‘New York’£ºÉ¸Ñ¡³öÆÜÉíÔÚ “New York” ÊеĿͻ§¡£
Öª×ãÕâÁ½¸öÌõ¼þͬʱ½¨ÉèµÄ¿Í»§»á±»·µ»ØΪЧ¹û¡£
ÒÔÉϾÍÊÇsqlÖÐwhereºóÔõô¼ÓÁ½¸öandµÄÏêϸÄÚÈÝ£¬¸ü¶àÇë¹Ø×¢±¾ÍøÄÚÆäËüÏà¹ØÎÄÕ£¡