The FIRST() function returns the first value of the selected column.
Syntax:-
SELECT FIRST(column_name) FROM table_name;
OR
SELECT column_name FROM table_name ORDER BY column_name ASC LIMIT 1;
Example:-
The subsequent SQL selects the first value of the “VisitorName” column from the “Visitors” table:-

SELECT FIRST(VisitorName) AS FirstVisitor FROM Visitors;

OR

SELECT VisitorName FROM Visitors ORDER BY VisitorID ASC LIMIT 1;

Categories: SQL Function

0 thoughts on “SQL First()”

Leave a Reply