searchsanjaysharma
asked on
How to create a temporary table from resultset.
When i run this query i get the following resultset
SELECT distinct SubjectCode from IND13I.DBO.MSTMASSSTUDENTS
WHERE Course='B.Arch' and semester=1 order by 1
Resultset
SubjectCode
AR101
AR102
AR103
AR104
AR105
AR106
AR107
How to display this in horizontal or as columns or how to transpose it so that i can create the table as
create table x (AR101 VARCHAR(200),AR102 VARCHAR(200) and so on
Is it possible.
SELECT distinct SubjectCode from IND13I.DBO.MSTMASSSTUDENTS
WHERE Course='B.Arch' and semester=1 order by 1
Resultset
SubjectCode
AR101
AR102
AR103
AR104
AR105
AR106
AR107
How to display this in horizontal or as columns or how to transpose it so that i can create the table as
create table x (AR101 VARCHAR(200),AR102 VARCHAR(200) and so on
Is it possible.
Yes, it is possible what you are looking for is called dynamic pivot functioanlity there are many examples out there in the web, I suggest you to look into one
ASKER
Can you send any link.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ashilo,
I suspect the keyword here was "dynamic" :)
I suspect the keyword here was "dynamic" :)
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
tx