在SQL中,SELECT语句用于从数据库中检索数据。以下是SELECT语句的基本用法:
SELECT * FROM table_name;
SELECT column1, column2 FROM table_name;
SELECT column1 AS alias1, column2 AS alias2 FROM table_name;
SELECT column1, column2, column1 + column2 AS total FROM table_name;
SELECT * FROM table_name WHERE column1 = 'value';
SELECT * FROM table_name ORDER BY column1 ASC/DESC;
SELECT * FROM table_name LIMIT 10;
SELECT column1, SUM(column2) FROM table_name GROUP BY column1;
这些是SELECT语句的基本用法,可以根据具体需求进行进一步的定制和组合。