Simple sql query code - can output the first 10 records:

The following is a simple SQL query that outputs the first 10 records:

sql复制代码

SELECT * FROM table_name LIMIT 10;

Among them, table_nameis 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 BYclause 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.

Guess you like

Origin blog.csdn.net/m0_66194642/article/details/132608196