Thanks for the correction.
Oracle assumes the order by, SQL Server does not.
Yes?
-----Original Message-----
From: Schlieper Paul
[mailto:mssqldba-ezmlmshield-x21313289.[Email address protected]
Sent: Monday, June 28, 2004 12:36 PM
To: LazyDBA Discussion
Subject: RE: Row counts in SQL 2000
It is not required in SQL Server, and follows the group by when used at all.
-----Original Message-----
From: Chris Hagemaier
[mailto:mssqldba-ezmlmshield-x65843928.[Email address protected]
Sent: Monday, June 28, 2004 3:15 PM
To: LazyDBA Discussion
Subject: RE: Row counts in SQL 2000
select grp_by_col, count(*)
from tbl
order by grp_by_col
group by grp_by_col
Strange, how in SQL Server the 'order by' seems to be required.
-----Original Message-----
From: Agarwalla Avineet (Corporate)
[mailto:mssqldba-ezmlmshield-x14449456.[Email address protected]
Sent: Monday, June 28, 2004 11:32 AM
To: LazyDBA Discussion
Subject: Row counts in SQL 2000
Hi All,
I need help in writing a SQL command to count the # of rows for each
value in a table's column. I have 21 distinct values for a column Customer
in the table Contact. How do I do this?
Thanks & Regards,
Avineet Agarwalla
This e-mail, together with any attachments, is confidential. It may be
read, copied and used only by the intended recipient. If you have received
it in error, please notify the sender immediately by e-mail or telephone.
Please then delete it from your computer without making any copies or
disclosing it to any other person. Any unauthorized copying, disclosure or
distribution of the material in this e-mail is strictly forbidden.
---------------------------------------------------------------------
TO REPLY TO EVERBODY , PLEASE CLICK REPLY-ALL, NOT JUST REPLY
Website : http://www.LazyDBA.com
To unsubscribe: http://www.lazydba.com/unsubscribe.html
For additional commands, e-mail: mssqldba-[Email address protected]
---------------------------------------------------------------------
TO REPLY TO EVERBODY , PLEASE CLICK REPLY-ALL, NOT JUST REPLY
Website : http://www.LazyDBA.com
To unsubscribe: http://www.lazydba.com/unsubscribe.html
For additional commands, e-mail: mssqldba-[Email address protected]
---------------------------------------------------------------------
TO REPLY TO EVERBODY , PLEASE CLICK REPLY-ALL, NOT JUST REPLY
Website : http://www.LazyDBA.com
To unsubscribe: http://www.lazydba.com/unsubscribe.html
For additional commands, e-mail: mssqldba-[Email address protected]
MS Sql Server LazyDBA home page