FIRST() function
FIRST() function returns the value of the first record in the specified column.
SQL FIRST() syntax
##Note: Only MS Access supports FIRST () function.
SQL FIRST() Workspace in SQL Server, MySQL, and OracleSQL Server Syntax
ORDER BY column_name ASC;
column_name ASCLIMIT 1;
LIMIT 1;
column_name ASCWHERE ROWNUM <=1;
WHERE ROWNUM <=1;
Demo Database
In this tutorial, we will use the php sample database.
The following is the data selected from the "Websites" table:
| id | name | url --------+-------+---------+
| 1 | Google | https://www.google.cm/ | 1 | USA |
| 2 | Taobao | https://www.taobao.com/ | 13 | CN |
| 3 | php Chinese website | //m.sbmmt.com/ | 4689 | CN |
| 4 | Weibo | http://weibo.com/ | 20 | CN |
| 5 | Facebook | https://www.facebook.com/ | 3 | USA |
| 6 | Baidu | https://www.baidu.com/ | 4 | CN |
| 7 | stackoverflow | http://stackoverflow.com/ | 0 | IND |
+----+---- ----------+--------------------------+-------+-- -------+
SQL FIRST() ExampleThe following SQL statement selects the first record in the "name" column of the "Websites" table Value:













![Getting Started with PHP Practical Development: PHP Quick Creation [Small Business Forum]](https://img.php.cn/upload/course/000/000/035/5d27fb58823dc974.jpg)









