Click here to Skip to main content
   

Database

 
QuestionSMO Retrieve Table Record Pinmembersavbace28-Jan-13 3:31 
AnswerRe: SMO Retrieve Table Record PinmvpSandeep Mewara28-Jan-13 3:42 
AnswerRe: SMO Retrieve Table Record Pinmembersavbace28-Jan-13 3:55 
QuestionRe: SMO Retrieve Table Record PinmvpEddy Vluggen28-Jan-13 4:21 
AnswerRe: SMO Retrieve Table Record PinmvpSandeep Mewara28-Jan-13 4:22 
AnswerRe: SMO Retrieve Table Record Pinmembersavbace28-Jan-13 4:40 
Questionhow can reporting in this Situation [modified] Pinmemberkarimkpg26-Jan-13 3:38 
AnswerRe: how can reporting in this Situation PinmvpSandeep Mewara26-Jan-13 7:02 
You need to use SQL PIVOT:
MSDN: Using PIVOT and UNPIVOT[^]
 
Try:
SELECT 
    'TotalValue' AS Sum_Total_Values_By_City, [London], [Tehran], [Paris]
FROM
  (SELECT City, Value 
   FROM MyTable) AS SourceTable
   PIVOT
   (
     SUM(Value)
     FOR City IN ([London], [Tehran], [Paris])
   ) AS PivotTable
Sandeep Mewara
Microsoft ASP.NET MVP 2012 & 2013
 

[My Latest Article(s)]:
How to extend a WPF Textbox to Custom Picker
Server side Delimiters in ASP.NET

QuestionQuery to concatenate multiple rows based on sequence in results set PinmemberAlex Lush24-Jan-13 23:43 
AnswerRe: Query to concatenate multiple rows based on sequence in results set PinmvpEddy Vluggen25-Jan-13 2:51 
AnswerRe: Query to concatenate multiple rows based on sequence in results set PinmemberShameel25-Jan-13 4:20 
GeneralRe: Query to concatenate multiple rows based on sequence in results set PinmemberAlex Lush25-Jan-13 4:30 
AnswerRe: Query to concatenate multiple rows based on sequence in results set Pinmembermmccarth25-Jan-13 6:21 
QuestionSyntax error (Missing Operator) in Query expression ':0:1 PinmemberIgaBaro23-Jan-13 15:40 
AnswerRe: Syntax error (Missing Operator) in Query expression ':0:1 PinmemberMycroft Holmes23-Jan-13 16:02 
GeneralRe: Syntax error (Missing Operator) in Query expression ':0:1 PinmemberIgaBaro23-Jan-13 16:25 
GeneralRe: Syntax error (Missing Operator) in Query expression ':0:1 PinmemberPIEBALDconsult23-Jan-13 16:37 
GeneralRe: Syntax error (Missing Operator) in Query expression ':0:1 PinmemberIgaBaro23-Jan-13 17:16 
GeneralRe: Syntax error (Missing Operator) in Query expression ':0:1 PinmemberPIEBALDconsult23-Jan-13 17:26 
GeneralRe: Syntax error (Missing Operator) in Query expression ':0:1 PinmemberIgaBaro23-Jan-13 17:58 
GeneralRe: Syntax error (Missing Operator) in Query expression ':0:1 PinmemberPIEBALDconsult23-Jan-13 17:59 
AnswerRe: Syntax error (Missing Operator) in Query expression ':0:1 PinmvpRichard MacCutchan24-Jan-13 0:22 
GeneralRe: Syntax error (Missing Operator) in Query expression ':0:1 PinmemberPIEBALDconsult24-Jan-13 6:48 
GeneralRe: Syntax error (Missing Operator) in Query expression ':0:1 PinmemberIgaBaro24-Jan-13 6:54 
GeneralRe: Syntax error (Missing Operator) in Query expression ':0:1 PinmemberPIEBALDconsult24-Jan-13 7:00 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.


Advertise | Privacy | Mobile
Web03 | 2.8.150224.1 | Last Updated 1 Mar 2015
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid