![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
I want to build query to return how many rows are in this query: select distinct c1, c2 from t1 But SQL won't accept this syntax: select count (distinct c1, c2) from t1 Does someone know how to count multiple distinct columns? Thanks. -- Disclaimer: This post is solely an individual opinion and does not speak on behalf of any organization. |
#3
| |||
| |||
|
|
One method is to use a derived table: SELECT COUNT(*) FROM ( SELECT DISTINCT c1, c2 FROM t1) AS t1 |
#4
| |||
| |||
|
![]() |
| Thread Tools | |
| Display Modes | |
| |