sqlÖÐ*µÄÓ÷¨
sql ÖÐµÄ * ÊÇÒ»¸öͨÅä·û£¬¾ßÓÐÒÔÏÂÓ÷¨£ºÅÌÎÊËùÓÐÁУºselect * from table_name;ÓÖÃûΪËùÓÐÁУºselect * as all_columns from table_name;ÔÚ where ×Ó¾äÖвéÕÒÌض¨Öµ£ºselect from table_name where like ‘%value%’;Óë¾ÛºÏº¯ÊýÒ»ÆðʹÓãºselect sum(*) from table_name;
SQL ÖÐ * µÄÓ÷¨
SQL ÖÐµÄ * £¨ÐǺţ©ÊÇÒ»¸öͨÅä·û£¬ÔÚÖݪÖÅÌÎÊÖж¼ÓÐÆÕ±éµÄÓÃ;¡£
ÅÌÎÊËùÓÐÁÐ
×î³£¼ûµÄÓ÷¨ÊǼìË÷±íÖеÄËùÓÐÁС£ÀýÈ磺
SELECT * FROM table_name;
µÇ¼ºó¸´ÖÆ
´ËÅÌÎʽ«·µ»Ø±íÖÐËùÓÐÁеÄÖµ¡£
ÓÖÃûΪËùÓÐÁÐ
¿ÉÒÔΪ * Ìí¼ÓÒ»¸öÌåÃû£¬ÒÔ±ãÇáËÉÒýÓÃËùÓÐÁУº
SELECT * AS all_columns FROM table_name;
µÇ¼ºó¸´ÖÆ
´ËÅÌÎʽ«·µ»ØÒ»¸öÃûΪ “all_columns” µÄÐéÄâÁУ¬ÆäÖаüÀ¨±íÖеÄËùÓÐÁÐÖµ¡£
ʹÓà * ÔÚ WHERE ×Ó¾äÖÐ
¿ÉÒÔʹÓà * ÔÚ WHERE ×Ó¾äÖвéÕÒ¾ßÓÐÌض¨ÖµµÄÈκÎÁС£ÀýÈ磺
SELECT * FROM table_name WHERE * LIKE '%value%';
µÇ¼ºó¸´ÖÆ
´ËÅÌÎʽ«·µ»ØËùÓаüÀ¨ “value” ×Ö·û´®µÄÁÐÖµ¡£
ʹÓà * Óë¾ÛºÏº¯Êý
¿ÉÒÔ½« * Óë¾ÛºÏº¯Êý£¨ÀýÈç SUM¡¢COUNT£©Ò»ÆðʹÓÃÀ´ÅÌËãËùÓÐÁеÄ×ܺͻò¼ÆÊý¡£ÀýÈ磺
SELECT SUM(*) FROM table_name;
µÇ¼ºó¸´ÖÆ
´ËÅÌÎʽ«·µ»Ø±íÖÐËùÓÐÊýÖµÁеÄ×ܺ͡£
×¢ÖØÊÂÏî
ʹÓà * ʱӦעÖØÒÔÏÂÊÂÏ
Ëü¿ÉÒÔµ¼ÖÂÅÌÎÊÐÔÄÜϽµ£¬ÓÉÓÚÐèÒª¼ìË÷ËùÓÐÁС£
Ëü²»ÊÊÓÃÓÚ¿ç¶à¸ö±íµÄÁª½ÓÅÌÎÊ¡£
ÒÔÉϾÍÊÇsqlÖÐ*µÄÓ÷¨µÄÏêϸÄÚÈÝ£¬¸ü¶àÇë¹Ø×¢±¾ÍøÄÚÆäËüÏà¹ØÎÄÕ£¡