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
How to identify corrupt Excel-Objects?
Save password setting not retained in Outlook
Access 2003 - Issue with .AddNew keywork after Access Migration to SQL Sever
Sharepoint + Trusts + People Picker
How does one configure SPN for an ISA 2006 and NLB Exchange 2007 CAS-setup.
What is the script to do the following?
Problem automating word on IIS
Need Driver for CDROM
Nokia E72 Microsoft Mail for Exchange -- Possible for Single User?
Reset autonumbering in a table automatically