Re: SQL Query Question
- From: markc600@xxxxxxxxxxx
- Date: 12 Apr 2006 12:04:07 -0700
SELECT Date,
SUM(CASE WHEN ProductTypeID=1 THEN Quantity ELSE 0 END) AS Type1,
SUM(CASE WHEN ProductTypeID=2 THEN Quantity ELSE 0 END) AS Type2,
SUM(CASE WHEN ProductTypeID=3 THEN Quantity ELSE 0 END) AS Type3
FROM TableA
GROUP BY Date
.
- References:
- SQL Query Question
- From: commerce
- SQL Query Question
- Prev by Date: Re: insert into temp table based on if condition
- Next by Date: Re: insert into temp table based on if condition
- Previous by thread: SQL Query Question
- Next by thread: Re: SQL Query Question
- Index(es):
Relevant Pages
|