Click here to Skip to main content
12,453,183 members (63,223 online)
   

Database

 
QuestionSMO Retrieve Table Record Pin
savbace28-Jan-13 2:31
membersavbace28-Jan-13 2:31 
AnswerRe: SMO Retrieve Table Record Pin
Sandeep Mewara28-Jan-13 2:42
mvpSandeep Mewara28-Jan-13 2:42 
AnswerRe: SMO Retrieve Table Record Pin
savbace28-Jan-13 2:55
membersavbace28-Jan-13 2:55 
QuestionRe: SMO Retrieve Table Record Pin
Eddy Vluggen28-Jan-13 3:21
mvpEddy Vluggen28-Jan-13 3:21 
AnswerRe: SMO Retrieve Table Record Pin
Sandeep Mewara28-Jan-13 3:22
mvpSandeep Mewara28-Jan-13 3:22 
AnswerRe: SMO Retrieve Table Record Pin
savbace28-Jan-13 3:40
membersavbace28-Jan-13 3:40 
Questionhow can reporting in this Situation Pin
karimkpg26-Jan-13 2:38
memberkarimkpg26-Jan-13 2:38 
AnswerRe: how can reporting in this Situation Pin
Sandeep Mewara26-Jan-13 6:02
mvpSandeep Mewara26-Jan-13 6: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 Pin
Alex Lush24-Jan-13 22:43
memberAlex Lush24-Jan-13 22:43 
AnswerRe: Query to concatenate multiple rows based on sequence in results set Pin
Eddy Vluggen25-Jan-13 1:51
mvpEddy Vluggen25-Jan-13 1:51 
AnswerRe: Query to concatenate multiple rows based on sequence in results set Pin
Shameel25-Jan-13 3:20
memberShameel25-Jan-13 3:20 
GeneralRe: Query to concatenate multiple rows based on sequence in results set Pin
Alex Lush25-Jan-13 3:30
memberAlex Lush25-Jan-13 3:30 
AnswerRe: Query to concatenate multiple rows based on sequence in results set Pin
mmccarth25-Jan-13 5:21
membermmccarth25-Jan-13 5:21 
QuestionSyntax error (Missing Operator) in Query expression ':0:1 Pin
IgaBaro23-Jan-13 14:40
memberIgaBaro23-Jan-13 14:40 
AnswerRe: Syntax error (Missing Operator) in Query expression ':0:1 Pin
Mycroft Holmes23-Jan-13 15:02
memberMycroft Holmes23-Jan-13 15:02 
GeneralRe: Syntax error (Missing Operator) in Query expression ':0:1 Pin
IgaBaro23-Jan-13 15:25
memberIgaBaro23-Jan-13 15:25 
GeneralRe: Syntax error (Missing Operator) in Query expression ':0:1 Pin
PIEBALDconsult23-Jan-13 15:37
memberPIEBALDconsult23-Jan-13 15:37 
GeneralRe: Syntax error (Missing Operator) in Query expression ':0:1 Pin
IgaBaro23-Jan-13 16:16
memberIgaBaro23-Jan-13 16:16 
GeneralRe: Syntax error (Missing Operator) in Query expression ':0:1 Pin
PIEBALDconsult23-Jan-13 16:26
memberPIEBALDconsult23-Jan-13 16:26 
GeneralRe: Syntax error (Missing Operator) in Query expression ':0:1 Pin
IgaBaro23-Jan-13 16:58
memberIgaBaro23-Jan-13 16:58 
GeneralRe: Syntax error (Missing Operator) in Query expression ':0:1 Pin
PIEBALDconsult23-Jan-13 16:59
memberPIEBALDconsult23-Jan-13 16:59 
AnswerRe: Syntax error (Missing Operator) in Query expression ':0:1 Pin
Richard MacCutchan23-Jan-13 23:22
mvpRichard MacCutchan23-Jan-13 23:22 
GeneralRe: Syntax error (Missing Operator) in Query expression ':0:1 Pin
PIEBALDconsult24-Jan-13 5:48
memberPIEBALDconsult24-Jan-13 5:48 
GeneralRe: Syntax error (Missing Operator) in Query expression ':0:1 Pin
IgaBaro24-Jan-13 5:54
memberIgaBaro24-Jan-13 5:54 
GeneralRe: Syntax error (Missing Operator) in Query expression ':0:1 Pin
PIEBALDconsult24-Jan-13 6:00
memberPIEBALDconsult24-Jan-13 6:00 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    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
Web02 | 2.8.160826.1 | Last Updated 27 Aug 2016
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid