title: Yii2: Get raw sql of $query->count('*') in Yii2
body: <p>I want to get the raw query for <code>$query-&gt;count("*")</code>.</p>
  
  <p>I have tried</p>
  
  <pre><code>$s=$query-&gt;count("*");
  $s=$s-&gt;createCommand()-&gt;sql;
  </code></pre>
  
  <p>It does not work.</p>
  
  <p>Usually I do <code>$s=$query-&gt;createCommand()-&gt;sql;</code> to get raw sql which works fine. How to get it for <code>count('*')</code>. Please help.</p>