The following is a simple SQL query that outputs the first 10 records:
sql复制代码
SELECT * FROM table_name LIMIT 10; |
Among them, table_name
is the name of the table you want to query. This query will return the first 10 records in the table. If you want to get the first 10 records in a specific order (e.g. sorted by ID), you can add a ORDER BY
clause like this:
sql复制代码
SELECT * FROM table_name ORDER BY id LIMIT 10; |
This will sort by ID in ascending order and return the first 10 records.