Unique vs Distinct keyword in Oracle

前端 未结 4 1772
渐次进展
渐次进展 2021-01-18 17:54

I am a bit confused about the uses of these words. I have a table with he following columns: SITE, LAT, LONG, NAME, ......

I want results with unique (or is it disti

4条回答
  •  余生分开走
    2021-01-18 18:33

    select unique colA, colB from atable
    
    select distinct colA, colB from atable
    

    In this context, unique and distinct mean the same thing.

    Distinct however is ANSI standard, whereas unique is not.

    Please note that unique has many other meanings when used in other area's ie index creation etc.

提交回复
热议问题