
July 12th, 2011, 08:30 AM
|
|
Contributing User
|
|
Join Date: Nov 2008
Posts: 68

Time spent in forums: 12 h 49 m
Reputation Power: 5
|
|
Incredible! The more I learn about SQL the more amazed I am. BTW your simply-sql.com site does not have any links on it to purchase your book (unless I missed something... I don't see any links at all just a static page), I do see it on Amazon though, I will definitely buy it on Amazon unless you have a direct way to buy. Thanks for your help!
Quote: | Originally Posted by r937
Code:
SELECT model
, make
, COUNT(CASE WHEN location = 1
THEN location END ) AS Count1
, COUNT(CASE WHEN location = 2
THEN location END ) AS Count2
, COUNT(CASE WHEN location = 3
THEN location END ) AS Count3
FROM daTable
GROUP
BY model
, make
|
|