17,377
社区成员
发帖
与我相关
我的任务
分享
SQL> select * from t4;
ID1 ID2
---------- ----------
1 2
1 3
1 2
--查看某一列不同的记录数
SQL> select count(distinct id1) from t4;
COUNT(DISTINCTID1)
------------------
1
SQL> select count(distinct id2) from t4;
COUNT(DISTINCTID2)
------------------
2
--查看表中各列不同记录数
SQL> select count(distinct id1||id2) from t4;
COUNT(DISTINCTID1||ID2)
-----------------------
2