sqlÖеIJ»¼´ÊÇ·ûºÅÔõôÊäÈë
sql ÖеIJ»¼´ÊÇ·ûºÅΪ “¡±£¬ÓÃÓÚ½ÏÁ¿Á½¸öÖµÊÇ·ñ²»ÏàµÈ£¬·µ»Ø²¼¶ûÖµ true »ò false¡£Ëü¿ÉÓÃÓÚ½ÏÁ¿±í´ïʽ»ò³£Á¿£¬Èç “select * from table_name where column_name ‘value’;”¡£¸ÃÅÌÎʽ«Ñ¡Ôñ “column_name” ÁÐÖµ²»¼´ÊÇ ‘value’ µÄËùÓмͼ¡£
SQL ÖÐÊäÈë²»¼´ÊÇ·ûºÅ
SQL ÖеIJ»¼´ÊÇ·ûºÅÊÇ “”¡£ËüÓÃÓÚ½ÏÁ¿Á½¸öÖµ£¬²¢·µ»Ø²¼¶ûÖµ (TRUE »ò FALSE)£¬ÌåÏÖÕâÁ½¸öÖµÊÇ·ñ²»ÏàµÈ¡£
ʹÓò»¼´ÊÇ·ûºÅ
¿ÉÒÔʹÓà “” ÔËËã·ûÀ´½ÏÁ¿Á½¸ö±í´ïʽ»ò³£Á¿£¬ÈçÏÂËùʾ£º
SELECT * FROM table_name WHERE column_name 'value';
µÇ¼ºó¸´ÖÆ
´ËÅÌÎʽ«´Ó “table_name” ±íÖÐÑ¡ÔñËùÓмͼ£¬ÆäÖÐ “column_name” ÁÐÖеÄÖµÓë ‘value’ ²»ÏàµÈ¡£
ʾÀý
Òª²éÕÒ²»¼´ÊÇ 10 µÄËùÓÐÐÐµÄ “value” ÁÐÖµ£¬¿ÉÒÔʹÓÃÒÔÏÂÅÌÎÊ£º
SELECT value FROM table_name WHERE value 10;
µÇ¼ºó¸´ÖÆ
¸ÃÅÌÎʽ«·µ»ØËùÓÐ “value” ÁÐÖµ£¬ÕâЩֵÓëÊý×Ö 10 ²»ÏàµÈ¡£
×¢ÖØ£º
“” ÔËËã·ûÒ²³ÆΪ “²»¼´ÊÇ” ÔËËã·û¡£
һЩÊý¾Ý¿âÖÎÀíϵͳ (DBMS) ¿ÉÄÜÖ§³ÖÌØÁíÍâÔËËã·û£¬ÀýÈç “!=”£¬Ëü¾ßÓÐÓë “” ÏàͬµÄ¹¦Ð§¡£
ÒÔÉϾÍÊÇsqlÖеIJ»¼´ÊÇ·ûºÅÔõôÊäÈëµÄÏêϸÄÚÈÝ£¬¸ü¶àÇë¹Ø×¢±¾ÍøÄÚÆäËüÏà¹ØÎÄÕ£¡