Hier ist ein Beispiel
use tempdb go create table t1 ( col1 int null ) go insert into t1 values (1),(2),(3),(4),(5), (1),(2),(3),(4), (1),(2),(3), (1),(2), (1), (null) go select count(distinct col1) as CountDistinct, count(all col1) as CountAll, count(*) as CountAsterisk from t1 go drop table t1 goHier ist das Resultset
CountDistinct CountAll CountAsterisk ------------- ----------- ------------- 5 15 16
Keine Kommentare:
Kommentar veröffentlichen