= | Equal | 等於 |
> | Greater than | 大於 |
< | Less than | 小於 |
>= | Greater than or equal to | 大於或等於 |
<= | Less than or equal to | 小於或等於 |
<> | Not equal to | 不等於 |
LIKE | String comparison test | 包含 |
一般 Select |
1. 選擇 items_ordered 資料表中的所有欄位 2. 選擇 items_ordered 資料表中的customerid 及item 3. 選擇 items_ordered 資料表中的customerid ,item,quantity及price |
按條件的Select 利用 LIKE |
1. 選擇 items_ordered 資料表中的customerid ,item,及price,其CustomerID為 10449 2. 選擇 items_ordered 資料表中購買了item為Tent的customerid 及item 3. 選擇 items_ordered 資料表中購買了item為Tent或Umbrella的customerid 及item --------------------包含某些字 ,使用like--------------------- 4. 選擇 items_ordered 資料表中item為以字母“S”開始的所有資料 5. 選擇 items_ordered 資料表中item為以字母“t”結尾的customerid ,item及price 6. 選擇 items_ordered 資料表中item為以字母中包含“o”的item及price --------------------範圍----------------------- 7. 選擇 items_ordered 資料表中price高於30的item及price 8. 選擇 items_ordered 資料表中price小於50的item及price |
按條件的Select 利用AND, OR, IN, BETWEEN..AND, *(萬用字元), LIKE |
------------------AND, OR, <>------------------- |
按條件的Select 利用 AVG(), COUNT(), MAX(), MIN(), SUM() |
1a. 計算 items_ordered 資料表中所有物品的平均價錢 |