SELECT column1, column2, column3,... FROM your_table_name
SELECT DISTINCT column1 FROM your_table_name
SELECT column1 AS alias1, column2 AS alias2, column3 AS alias3,... FROM your_table_name
SELECT * FROM your_table_name
WHERE條件子句可以是文字、數值或時間,底下是支援的運算子:
SELECT * FROM your_table_name WHERE column1='value1'
此部分可以配合萬用字元,如下所示:
SELECT * FROM your_table_name WHERE column1 LIKE '%value1%'
SELECT * FROM your_table_name WHERE column1 LIKE '_value1%'
SELECT * FROM your_table_name WHERE column1 = number1
ANSI-SQL提供三種資料類型如下:
SELECT * FROM your_table_name WHERE column1='2023-01-01'
SELECT * FROM your_table_name WHERE column1='20:23:01.01'
SELECT * FROM your_table_name WHERE column1='2023-01-01 20:23:01.01'