Microsoft
Software
Hardware
Network
Question : Sql Question
I have this table:
points | type | name
100 | 1 | John
100 | 1 | micke
100 | 3 | johen
100 | 2 | Peter
100 | 3 | Micke
I whant this reults:
Name | pointsTYP1 | Points TYP2 | points TYP3
John | 500 | 555 | 1100
Micke | 545 | 5151 | 5150
Who can i do this with 1 sql?
Answer : Sql Question
Or you could do:
SELECT name, SUM(CASE WHEN type = 1 THEN points ELSE 0 END) as pointsType1, SUM(CASE WHEN type = 2 THEN points ELSE 0 END) as pointsType2, SUM(CASE WHEN type = 3 THEN points ELSE 0 END) as pointsType3 FROM table
GROUP BY name
Random Solutions
forward an e-mail address in Exchange 2003 to an external address
From Combo box in another form.. move to record in another form
How do I import a text file into MS Access which appears to have verticle and hortintals breaks
iis forbiden access - cannot find incorect host header
Where Can I find a online free VBA manual?
Find Number Closest to Zero in Excel
How to show detail on summary report that is pulled into another report (sub-report)
DAO Recordset issue Access 2007 VBA
Error While Processing an Application in SAP BPC with SQL 2008 on backend.
VBA Variable as DLookup Criteria