SQL distinct for 2 fields in a database

前端 未结 5 1778
时光取名叫无心
时光取名叫无心 2020-12-04 17:35

Can you get the distinct combination of 2 different fields in a database table? if so, can you provide the SQL example.

5条回答
  •  既然无缘
    2020-12-04 17:57

    You can get result distinct by two columns use below SQL:

    SELECT COUNT(*) FROM (SELECT DISTINCT c1, c2 FROM [TableEntity]) TE
    

提交回复
热议问题