|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
using COUNT(*) on two columns
I have two columns:
screenWidth ----------------- 1.) 1600 2.) 1600 3.) 1600 screenHeight ---------------- 1.) 1200 2.) 1024 3.) 1200 Instead of doing a count on just column screenWidth, I want to do a count on matches for both columns. So in the above example, the results would show as following: Screen Resolutions ------------------------ 1600 x 1200 (The count would be 2) 1600 x 1024 (The count would be 1) Is this possible, and can someone give me an idea how it might be accomplished? Thanks Last edited by bjrcreations : November 27th, 2003 at 10:12 PM. |
|
#2
|
||||
|
||||
|
SELECT screenwidth, screenheight, count(screenwidth) AS "expr1"
FROM Table1 GROUP BY screenwidth, screenheight The code above will display: 1600 1200 2 1600 1024 1 |
![]() |
| Viewing: ASP Free Forums > Database > SQL Development > using COUNT(*) on two columns |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|