Hi,
Can you explain me the advantages of using one of these
statements?
I usually use the count(*) but i would like to know why
should we use one instead of the other.
Thanks a lot,
Best regardsIt's a purely syntactic difference. Use whatever one you like.
COUNT(*) is probably somewhat easier to read... but you could even use
COUNT(2349082349082398) if you felt like it.
"CC&JM" <anonymous@.discussions.microsoft.com> wrote in message
news:27d5a01c46356$61150000$a301280a@.phx
.gbl...
> Hi,
> Can you explain me the advantages of using one of these
> statements?
> I usually use the count(*) but i would like to know why
> should we use one instead of the other.
> Thanks a lot,
> Best regards|||The only instance where you could get different results would be where you
specify an actual column name instead of *. Using count(*) will return the
count of the number of rows, whilst count(<ColumnName> ) will return the
number of rows where <ColumnName> is not null.
R
"Adam Machanic" <amachanic@.hotmail._removetoemail_.com> wrote in message
news:exvVSq1YEHA.2868@.TK2MSFTNGP09.phx.gbl...
> It's a purely syntactic difference. Use whatever one you like.
> COUNT(*) is probably somewhat easier to read... but you could even use
> COUNT(2349082349082398) if you felt like it.
> "CC&JM" <anonymous@.discussions.microsoft.com> wrote in message
> news:27d5a01c46356$61150000$a301280a@.phx
.gbl...
>
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment