SQL SELECT FIRST
The SQL SELECT FIRST statement is used to retrieve the first record from the table. It is useful for scenarios where you need to fetch the first entry of a query result.
Syntax
The basic syntax for SELECT FIRST is:
SELECT FIRST column_name
FROM table_name;
Example
Here, we will fetch the first product ordered in the Orders table.
Code Example
-- Select the first product ordered
SELECT FIRST Product FROM Orders;
Output
Laptop
Explanation
- The query retrieves the first product ordered in the Orders table.
- The result will be based on the order in which the data was inserted into the table.