|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Stay one step ahead of the competition. Evaluate and give feedback
on some of the hottest web development tools on the market today.
Make your opinion heard! Click
Here
|
|
#1
|
|||
|
|||
|
count and destinct?
Hi,
If I have a database table like this: webpageid entrydate websiteid 3 2/6/03 4:51:49 PM 1 1 2/6/03 4:47:46 PM 1 1 2/6/03 4:45:07 PM 2 1 2/6/03 4:43:45 PM 7 3 2/6/03 4:42:18 PM 7 And I want to query the table to bring back the count of each websiteid. I am looking for a result like this: websiteid: 1, count 2 websiteid: 2, count 1 websiteid: 7, count 2 Does anyone know the sql that will bring back those results? or is it even possible to do this? |
|
#2
|
|||
|
|||
|
select websiteid, count(*) group by websiteid
|
![]() |
| Viewing: Dev Shed Forums > Databases > Database Management > count and destinct? |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|