By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,806 Members | 1,787 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,806 IT Pros & Developers. It's quick & easy.

count rows question

P: n/a
i have a table like this

StoreId DateClicked
1 1/1/2004
2 1/1/2004
1 1/1/2004
1 1/1/2004
1 1/1/2004
3 1/1/2004
2 1/1/2004
I want the result of the query to be this:

NumberOfClicks StoreId
4 1
2 2
1 3

what is the syntax for this? Thanks.

Jul 23 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
SELECT COUNT(*) AS number_of_clicks, storeid
FROM YourTable
GROUP BY storeid

--
David Portas
SQL Server MVP
--
Jul 23 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.