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
SENS service corruption? Susspeced Malware?
Login failed for user 'sa'. (.Net SqlClient Data Provider)
How my Dialog is gone!!
Is it possible to link Sharepoint Calendars to each other?
ASP.NET and Server.CreateObject
FILE RENAME IN FOXPRO
How can I tell who changed the Out of office message for an Exchange 2007 mailbox?
popup modal form - quest 3
Problem Opening Access 2000 Front-End with Access 2003.
Lost product key for MicroSoft Office 2008 Mac