ªð¦^¦Cªí ¤W¤@¥DÃD µo©«

MySQL¶i¶¥_SELECT½g(¤@)

MySQL¶i¶¥_SELECT½g(¤@)

MySQL¤¤SELECT»y¥yªº°ò¥»»yªk¬O¡G
SELECT [STRAIGHT_JOIN] [SQL_SMALL_RESULT] [SQL_BIG_RESULT] [HIGH_PRIORITY] [DISTINCT|DISTINCTROW|ALL] select_list [INTO {OUTFILE|DUMPFILE} 'file_name' export_options] [FROM table_references [WHERE where_definition] [GROUP BY col_name,...] [HAVING where_definition] [ORDER BY {unsighed_integer|col_name|formura} [ASC|DESC],...] [LIMIT [offset,] rows] [PROCEDURE procedure_name]]
    ±q³o­Ó°ò¥»»yªk¥i¥H¬Ý¥X¡A³Ì²³æªº SELECT»y¥y¬OSELECT select_list¡A¹ê»Ú¤W§Q¥Î³o­Ó³Ì²³æªºSELECT»y¥y¡A§A¤]¥i¥H§¹¦¨³\¦h§A´Á«Ýªº¥\¯à¡A­º¥ý§A¯à§Q¥Î¥¦¶i¦æMySQL©Ò¤ä«ùªº¥ô¦ó¹Bºâ¡A¨Ò¦p¡GSELECT 1+1¡A¥¦±Nªð¦^2¡F¨ä¦¸¡A§A¤]¯à§Q¥Î¥¦µ¹Åܶq½á­È¡A¦Ó¦bPHP¤¤¡A¹B¥ÎSELECT»y¥yªº³oºØ¥\¯à¡A§A´N¥i¥H¦Û¥Ñ¦a¹B¥ÎMySQLªº¨ç¼Æ¬°PHPµ{¦¡¶i¦æ¦UºØ¹Bºâ¡A¨Ã½á­Èµ¹Åܶq¡C¦b«Ü¦hªº®É­Ô¡A§A·|µo²{MySQL¾Ö¦³³\¦h¤ñPHP§ó¬°¥\¯à±j¤jªº¨ç¼Æ¡C
STRAIGHT_JOIN¡BSQL_SMALL_RESULT¡BSQL_BIG_RESULT¡BHIGH_PRIORITY¬OMySQL¹ïANSI SQL92ªºÂX®i¡C¦pªGÀu¤Æ¾¹¥H«D³Ì¨Î¦¸§ÇÁpµ²ªí¡A¨Ï¥ÎSTRAIGHT_JOIN¥i¥H¥[§Ö¬d¸ß¡C
SQL_SMALL_RESULT ©MSQL_BIG_RESULT¬O¤@²Õ¬Û¹ïªºÃöÁäµü¡C¥¦­Ì¥²¶·»PGROUP BY¡BDISTINCT©ÎDISTINCTROW¤@°_¨Ï¥Î¡CSQL_SMALL_RESULT§iª¾Àu¤Æ¾¹µ²ªG·|«Ü¤p¡A­n¨DMySQL¨Ï¥ÎÁ{®ÉªíÀx¦s³Ì²×ªºªí¦Ó¤£¬O¨Ï¥Î±Æ§Ç¡F¤Ï¤§¡ASQL_BIG_RESULT§iª¾Àu¤Æ¾¹µ²ªG·|«Ü¤p¡A­n¨DMySQL¨Ï¥Î±Æ§Ç¦Ó¤£¬O°µÁ{®Éªí¡C
HIGH_PRIORITY±N½á¤©SELECT¤ñ¤@­Ó§ó·sªíªº»y¥y§ó°ªªºÀu¥ý¯Å¡A¨Ï¤§¥i¥H¶i¦æ¤@¦¸Àu¥ýªº§Ö³tªº¬d¸ß¡C
¥H¤W¥|­ÓÃöÁäµüªº¨Ï¥Î¤èªkªº½T¤ñ¸û±âÀß¡C©¯¹Bªº¬O¡A¦bµ´¤j¦h¼Æ±¡ªp¤U¡A¦bMySQL¤¤§Ú­Ì§¹¥þ¥i¥H¿ï¾Ü¤£¨Ï¥Î³o¥|­ÓÃöÁäµü¡C
DISTINCT¡B DISTINCTROW¹ï¬d¸ßªð¦^ªºµ²ªG¶°´£¨Ñ¤F¤@­Ó³Ì°ò¥»¦ý¬O«Ü¦³¥Îªº¹LÂo¡C¨º´N¬Oµ²ªG¶°¤¤¥u§t«D­«½Æ¦æ¡C¦b³o¸Ì­nª`·Nªº¬O¡A¹ïÃöÁäµü DISTINCT¡BDISTINCTROW¨Ó»¡¡AªÅ­È³£¬O¬Ûµ¥ªº¡AµL½×¦³¦h¤ÖNULL­È¡A¥u¿ï¾Ü¤@­Ó¡C¦ÓALLªº¥Îªk´N¦³µe³D²K¨¬¤§¶û¤F¡C¥¦¹ïµ²ªG¶°ªº²£¥Í¨S¦³¥ô¦ó¼vÅT¡C
INTO {OUTFILE|DUMPFILE} 'file_name' export_options¡A±Nµ²ªG¶°¼g¤J¤@­Ó¤å¥ó¡C¤å¥ó¦bªA°È¾¹¥D¾÷¤W³Q·s¼W¡A¨Ã¥B¤£¯à¬O¤w¸g¦s¦bªº¡C»y¥y¤¤ªºexport_options³¡¤Àªº»yªk»P¥Î¦bLOAD DATAINFILE»y¥y¤¤ªºFIELDS©MLINES¤l¥y¤¤ªº¬Û¦P¡A§Ú­Ì±N¦bMySQL¶i¶¥_LOAD DATA½g¤¤¸Ô²Ó°Q½×¥¦¡C¦ÓOUTFILE»PDUMPFILEªºÃöÁä¦rªº°Ï§O¬O¡G«á«e¥u¼g¤@¦æ¨ì¤å¥ó¡A¨Ã¨S¦³¥ô¦ó¦C©Î¦æµ²§ô¡C

Âà¦Û¡G
­Ó¤Hñ¦W@

        ÀR«ä¦Û¦b : ¤@¥y·Å·xªº¸Ü¡A´N¹³©¹§O¤H¨­¤WÅx­»¤ô¡A¦Û¤v·|ªg¨ì¨â¤Tºw¡C
ªð¦^¦Cªí ¤W¤@¥DÃD