sqlÖÐ_ÊÇʲôÒâ˼
ÔÚ sql ÖУ¬Ï»®Ïß (_) µÄÓÃ;°üÀ¨£º1. ×÷ΪÅÌÎÊÓï¾äÖеÄռλ·û£»2. ÓÃÓÚתÒåÌØÊâ×Ö·û£»3. ±êʶ sql ±£´æ×Ö£»4. ½¨ÉèÏÞȨÓÖÃû£»5. ½«ÁÐÅþÁ¬³É×Ö·û´®¡£
SQL ÖеÄÏ»®Ïߣ¨_£©
ÔÚ SQL ÖУ¬Ï»®Ïß (_) ÓжàÖÖÓÃ;£º
Ò»¡¢Õ¼Î»·û
ÔÚÅÌÎÊÓï¾äÖУ¬Ï»®Ïß¿É×÷Ϊռλ·û£¬ÌåÏÖÒ»¸öδ֪»ò¿É±äµÄÖµ¡£ÀýÈ磺
SELECT * FROM table_name WHERE column_name = ?;
µÇ¼ºó¸´ÖÆ
¶þ¡¢×ªÒå×Ö·û
Ï»®Ïß¿ÉÓÃÓÚתÒåÌØÊâ×Ö·û£¬Ê¹ÆäÔÚ SQL Óï¾äÖоßÓÐ×ÖÃæ¼ÄÒå¡£ÀýÈ磬ҪʹÓõ¥ÒýºÅ£¬¿ÉÒÔ½«ÆäתÒåΪ ‘_’£º
SELECT * FROM table_name WHERE column_name = 'John''s';
µÇ¼ºó¸´ÖÆ
Èý¡¢±êʶ±£´æ×Ö
ÔÚijЩÇéÐÎÏ£¬ÐèÒª½« SQL ±£´æ×ÖÓÃ×÷ÁÐÃû»ò±íÃû¡£´Ëʱ£¬¿ÉÒÔͨ¹ýÔÚÏ»®ÏߺóÌí¼ÓÒ»¸ö¿Õ¸ñÀ´±êʶ¸ÃÃû³Æ£º
CREATE TABLE _name (id INT, name VARCHAR(255));
µÇ¼ºó¸´ÖÆ
ËÄ¡¢ÏÞȨÓÖÃû
ÔÚÏ»®ÏߺóÌí¼ÓÒ»¸öÊý×Ö£¬¿ÉÒÔ½¨ÉèÏÞȨÓÖÃû¡£ÏÞȨÓÖÃû½öÔÚÄ¿½ñÅÌÎÊÖпɼû£¬²»»áÓ°ÏìÆäËûÅÌÎÊ¡£ÀýÈ磺
SELECT * FROM table_name AS _1;
µÇ¼ºó¸´ÖÆ
Îå¡¢½«ÁÐÅþÁ¬³É×Ö·û´®
ÔÚ GROUP_CONCAT() º¯ÊýÖУ¬¿ÉÒÔÓÃÏ»®Ïß½«¶à¸öÁÐÖµÅþÁ¬³ÉÒ»¸ö×Ö·û´®¡£ÀýÈ磺
SELECT GROUP_CONCAT(_1, '_', _2) FROM table_name;
µÇ¼ºó¸´ÖÆ
ÒÔÉϾÍÊÇsqlÖÐ_ÊÇʲôÒâ˼µÄÏêϸÄÚÈÝ£¬¸ü¶àÇë¹Ø×¢±¾ÍøÄÚÆäËüÏà¹ØÎÄÕ£¡