{"image_url":null,"url":"https://ichiroku11.hatenablog.jp/entry/2018/05/09/224638","provider_url":"https://hatena.blog","title":"T-SQL - count(*)\u3068count(\u30ab\u30e9\u30e0\u540d)\u306e\u9055\u3044","version":"1.0","published":"2018-05-09 22:46:38","author_name":"ichiroku11","provider_name":"Hatena Blog","width":"100%","height":"190","categories":["t-sql"],"blog_title":"\u3044\u3061\u308d\u3050","type":"rich","blog_url":"https://ichiroku11.hatenablog.jp/","html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Fichiroku11.hatenablog.jp%2Fentry%2F2018%2F05%2F09%2F224638\" title=\"T-SQL - count(*)\u3068count(\u30ab\u30e9\u30e0\u540d)\u306e\u9055\u3044 - \u3044\u3061\u308d\u3050\" class=\"embed-card embed-blogcard\" scrolling=\"no\" frameborder=\"0\" style=\"display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;\"></iframe>","author_url":"https://blog.hatena.ne.jp/ichiroku11/","description":"\u77e5\u3089\u306a\u304b\u3063\u305f\u306e\u3067\u30e1\u30e2\u3002 count(*)\u306f\u5168\u884c\u6570\u3092\u53d6\u5f97\u3059\u308b\u306e\u306b\u5bfe\u3057\u3066\u3001count(\u30ab\u30e9\u30e0\u540d)\u306fnull\u3092\u9664\u304f\u884c\u6570\u3092\u53d6\u5f97\u3057\u307e\u3059\u3002 \u30b5\u30f3\u30d7\u30eb\u30af\u30a8\u30ea\u3092\u66f8\u3044\u3066\u78ba\u8a8d\u3057\u3066\u304a\u304d\u307e\u3057\u3087\u3046\u3002 select -- null\u306b\u95a2\u4fc2\u306a\u304f\u5168\u884c\u6570\u3092\u53d6\u5f97 count(*) as [count(*)], -- null\u3092\u9664\u304f\u884c\u6570\u3092\u53d6\u5f97 count(Value) as [count(Value)] from (values (1, 100), (2, 200), (3, 200), (4, null), (5, 300), (6, 200)) as Test(Id, Value); -- \u884c\u306f\u5168\u90e8\u30676\u3001null\u3092\u9664\u304f\u30685 /*\u2026"}