Home [SQL] 去除重複列 Distinct
Post
Cancel

[SQL] 去除重複列 Distinct

Distinct將重複的資料列變為一列。

1
2
3
4
5
6
--取得4月份有賣出商品的商品ID列表
--但ID不能重複
select distinct 商品ID
from [販賣資料]
where [處理日] between '2006-04-01' and '2006-04-30'
This post is licensed under CC BY 4.0 by the author.