尊龙凯时人生就是搏

sqlÖÐlikeÓï¾äÔõôÓÃ

like Óï¾äÓÃÓÚÔÚ sql ÖÐƾ֤ģʽƥÅä×Ö·û»ò×Ö·û´®£¬Ó﷨Ϊ£ºselect column_name from table_name where column_name like ‘pattern’¡£ËüʹÓà % Æ¥ÅäÁã¸ö»ò¶à¸ö×Ö·û¡¢_ Æ¥Åäµ¥¸ö×Ö·û¡¢[ ] Æ¥Åä·½À¨ºÅÄÚ×Ö·û¡¢^ Æ¥Åä³ýÖ¸¶¨×Ö·ûÍâµÄÈκÎ×Ö·û¡£Ä¬ÈϾÞϸдÃô¸Ð£¬¿ÉʹÓà collate ×Ó¾ä¾ÙÐоÞϸд²»Ãô¸ÐÆ¥Åä¡£

SQL ÖÐ LIKE Óï¾äµÄÓ÷¨

LIKE Óï¾äµÄ×÷ÓÃ

LIKE Óï¾äÓÃÓÚÔÚ SQL ÅÌÎÊÖÐƾ֤ģʽƥÅä×Ö·û»ò×Ö·û´®¡£ËüÔÊÐíÄú²éÕÒ°üÀ¨Ìض¨×Ö·ûÐòÁлòÇкÏÌض¨Ä£Ê½µÄÖµ¡£

Óï·¨

SELECT column_name
FROM table_name
WHERE column_name LIKE 'pattern';

µÇ¼ºó¸´ÖÆ

ģʽƥÅä·û

LIKE Óï¾äʹÓÃÒÔÏÂÌØÊâ×Ö·û×÷ΪģʽƥÅä·û£º

%: Æ¥ÅäÁã¸ö»ò¶à¸ö×Ö·û¡£

_: Æ¥ÅäÈκε¥¸ö×Ö·û¡£

[ ]: Æ¥Åä·½À¨ºÅÄÚµÄÈκÎÒ»¸ö×Ö·û¡£

1: Æ¥Åä·½À¨ºÅÄÚ³ýÖ¸¶¨×Ö·ûÖ®ÍâµÄÈκÎÒ»¸ö×Ö·û¡£

ʾÀý

²éÕÒÒÔ “A” ¿ªÍ·µÄµ¥´Ê£º

SELECT word
FROM dictionary
WHERE word LIKE 'A%';

µÇ¼ºó¸´ÖÆ

²éÕÒ°üÀ¨ “ing” µÄµ¥´Ê£º

SELECT word
FROM dictionary
WHERE word LIKE '%ing';

µÇ¼ºó¸´ÖÆ

²éÕÒ²»ÒÔ “x” ×îºóµÄµ¥´Ê£º

SELECT word
FROM dictionary
WHERE word NOT LIKE '%x';

µÇ¼ºó¸´ÖÆ

²éÕÒ°üÀ¨Êý×ֵĵ¥´Ê£º

SELECT word
FROM dictionary
WHERE word LIKE '%[0-9]%';

µÇ¼ºó¸´ÖÆ

¾ÞϸдÃô¸ÐÐÔ

ĬÈÏÇéÐÎÏ£¬LIKE Óï¾äÊǾÞϸдÃô¸ÐµÄ¡£Òª¾ÙÐоÞϸд²»Ãô¸ÐµÄÆ¥Å䣬ÇëʹÓà COLLATE ×Ӿ䡣

ʾÀý£º¾Þϸд²»Ãô¸ÐµÄÆ¥Åä

SELECT word
FROM dictionary
WHERE word COLLATE NOCASE LIKE 'APPLE';

µÇ¼ºó¸´ÖÆ

×¢ÖØ£º

LIKE Óï¾äʹÓÃģʽƥÅ䣬¶ø²»ÊÇÍêÈ«Æ¥Åä¡£

Æ¥Åä·û % ºÍ _ ±ØÐèתÒå²Å»ªÆ¥ÅäÆä×Ô¼º¡£

¹ØÓÚÐÔÄÜ×î¼Ñ»¯£¬ÇëÔÚ LIKE ģʽµÄ¿ªÍ·ºÍ×îºóʹÓà %¡£


ÒÔÉϾÍÊÇsqlÖÐlikeÓï¾äÔõôÓõÄÏêϸÄÚÈÝ£¬¸ü¶àÇë¹Ø×¢±¾ÍøÄÚÆäËüÏà¹ØÎÄÕ£¡

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

Ïà¹ØÐÂÎÅ

ÁªÏµ尊龙凯时人生就是搏

18523999891

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

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

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