SQL FIRST() º¯Êý

FIRST() º¯Êý

FIRST() º¯Êý·µ»ØÖ¸¶¨µÄ×Ö¶ÎÖеÚÒ»¸ö¼Ç¼µÄÖµ¡£

Ìáʾ£º¿ÉʹÓà ORDER BY Óï¾ä¶Ô¼Ç¼½øÐÐÅÅÐò¡£

SQL FIRST() Óï·¨

SELECT FIRST(column_name) FROM table_name

SQL FIRST() ʵÀý

ÎÒÃÇÓµÓÐÏÂÃæÕâ¸ö "Orders" ±í£º

O_Id OrderDate OrderPrice Customer
1 2008/12/29 1000 Bush
2 2008/11/23 1600 Carter
3 2008/10/05 700 Bush
4 2008/09/28 300 Bush
5 2008/08/06 2000 Adams
6 2008/07/21 100 Carter

ÏÖÔÚ£¬ÎÒÃÇÏ£Íû²éÕÒ "OrderPrice" ÁеĵÚÒ»¸öÖµ¡£

ÎÒÃÇʹÓÃÈçÏ SQL Óï¾ä£º

SELECT FIRST(OrderPrice) AS FirstOrderPrice FROM Orders

½á¹û¼¯ÀàËÆÕâÑù£º

FirstOrderPrice
1000
VUE