在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語句的基本用法,可以根據具體需求進行進一步的定制和組合。