Click here to Skip to main content
15,892,809 members
Home / Discussions / Database
   

Database

 
GeneralRe: Convert Columns as Rows Pin
Vignesh Krishnan19-Jan-09 3:12
Vignesh Krishnan19-Jan-09 3:12 
GeneralRe: Convert Columns as Rows Pin
Wendelius19-Jan-09 6:55
mentorWendelius19-Jan-09 6:55 
GeneralRe: Convert Columns as Rows Pin
Vignesh Krishnan19-Jan-09 8:45
Vignesh Krishnan19-Jan-09 8:45 
GeneralRe: Convert Columns as Rows Pin
swjam19-Jan-09 11:26
swjam19-Jan-09 11:26 
GeneralRe: Convert Columns as Rows Pin
Vignesh Krishnan20-Jan-09 2:10
Vignesh Krishnan20-Jan-09 2:10 
GeneralRe: Convert Columns as Rows Pin
ColinM12319-Jan-09 11:45
ColinM12319-Jan-09 11:45 
GeneralRe: Convert Columns as Rows Pin
Wendelius20-Jan-09 8:17
mentorWendelius20-Jan-09 8:17 
GeneralRe: Convert Columns as Rows Pin
Wendelius20-Jan-09 8:15
mentorWendelius20-Jan-09 8:15 
I strongly encourage you to read the usage examples and test different variations using your tables. But to get you to start: For example, to get the first row of your data, you would fetch tme_on and month. I added an inline view since I don't have your table but you would replace that with a select to your table. The same idea goes with the other rows.
select 'tme_on' as heading, [jan],[dec], [nov]
from (
	select 1 as tme_on, 'jan' as [month]
	union
	select 2 as tme_on, 'dec' as [month]
	union
	select 3 as tme_on, 'nov' as [month]
) alias
pivot (
    sum(tme_on)
    for [month] in ([jan],[dec], [nov])
) as resulttable


The need to optimize rises from a bad design.My articles[^]

QuestionMS Access Query: Bit value in a Where Clause Pin
swjam19-Jan-09 0:03
swjam19-Jan-09 0:03 
Questionvertical to Horzontal data display Pin
Learner52018-Jan-09 23:22
Learner52018-Jan-09 23:22 
AnswerRe: vertical to Horzontal data display Pin
Wendelius19-Jan-09 2:17
mentorWendelius19-Jan-09 2:17 
GeneralRe: vertical to Horzontal data display Pin
Learner52019-Jan-09 3:12
Learner52019-Jan-09 3:12 
GeneralRe: vertical to Horzontal data display Pin
Wendelius19-Jan-09 6:52
mentorWendelius19-Jan-09 6:52 
QuestionSave Query Result as XML File in SQL Server 2005 Pin
Abhijit Jana18-Jan-09 23:22
professionalAbhijit Jana18-Jan-09 23:22 
AnswerDone !!! Pin
Abhijit Jana19-Jan-09 2:04
professionalAbhijit Jana19-Jan-09 2:04 
GeneralRe: Done !!! Pin
Wendelius19-Jan-09 8:50
mentorWendelius19-Jan-09 8:50 
QuestionHow to get leaf nodes of a particular Parent using sql Query Pin
vidhyap18-Jan-09 23:10
vidhyap18-Jan-09 23:10 
AnswerRe: How to get leaf nodes of a particular Parent using sql Query Pin
kingindra18-Jan-09 23:16
kingindra18-Jan-09 23:16 
AnswerRe: How to get leaf nodes of a particular Parent using sql Query Pin
Wendelius19-Jan-09 2:09
mentorWendelius19-Jan-09 2:09 
QuestionInsert Stmt returns -1 Pin
AB777118-Jan-09 19:43
AB777118-Jan-09 19:43 
AnswerRe: Insert Stmt returns -1 Pin
Reza Raad18-Jan-09 20:30
Reza Raad18-Jan-09 20:30 
GeneralRe: Insert Stmt returns -1 Pin
AB777118-Jan-09 20:39
AB777118-Jan-09 20:39 
GeneralRe: Insert Stmt returns -1 Pin
Reza Raad18-Jan-09 21:21
Reza Raad18-Jan-09 21:21 
AnswerRe: Insert Stmt returns -1 Pin
Aman Bhullar18-Jan-09 20:45
Aman Bhullar18-Jan-09 20:45 
GeneralRe: Insert Stmt returns -1 Pin
AB777118-Jan-09 20:52
AB777118-Jan-09 20:52 

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.