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
Preselect Checkboxlist Controls List Items based Based on matching DataTable Values
How do I print/export all Shared Folder Permissions and NTFS Security on Server 2003
Forms and listboxes default value
Access / SQL / VBA / filter records on form according to a date field
Multiple Personal.xls~RF251096.TMP files appearing in XLSTART folder
Outbound mail from Small Business Server 2003
a couple of date/time questions
Offline files Synchronization
All programs open Windows Media and not what I called up
I need to capture the output of the datagrid grdAttendees and record each Members Email Address.