<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>ichiroku11</author_name>
  <author_url>https://blog.hatena.ne.jp/ichiroku11/</author_url>
  <blog_title>いちろぐ</blog_title>
  <blog_url>https://ichiroku11.hatenablog.jp/</blog_url>
  <categories>
    <anon>t-sql</anon>
  </categories>
  <description>知らなかったのでメモ。 count(*)は全行数を取得するのに対して、count(カラム名)はnullを除く行数を取得します。 サンプルクエリを書いて確認しておきましょう。 select -- nullに関係なく全行数を取得 count(*) as [count(*)], -- nullを除く行数を取得 count(Value) as [count(Value)] from (values (1, 100), (2, 200), (3, 200), (4, null), (5, 300), (6, 200)) as Test(Id, Value); -- 行は全部で6、nullを除くと5 /*…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fichiroku11.hatenablog.jp%2Fentry%2F2018%2F05%2F09%2F224638&quot; title=&quot;T-SQL - count(*)とcount(カラム名)の違い - いちろぐ&quot; class=&quot;embed-card embed-blogcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;</html>
  <image_url></image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2018-05-09 22:46:38</published>
  <title>T-SQL - count(*)とcount(カラム名)の違い</title>
  <type>rich</type>
  <url>https://ichiroku11.hatenablog.jp/entry/2018/05/09/224638</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
