dshi15
asked on
sql create table statement
Hi Expert,
I have student table,
Id Name
1 Mary Lee
2 John Stall
3 Marshall Young
How I can write a query to create a table use each record in Name as column names?
Table structure like this.
Id [ Mary Lee] [John Stall] [Marshall Young]
because I have about 100 record in table, I need to create columns dynamic.
Thanks in advance.
I have student table,
Id Name
1 Mary Lee
2 John Stall
3 Marshall Young
How I can write a query to create a table use each record in Name as column names?
Table structure like this.
Id [ Mary Lee] [John Stall] [Marshall Young]
because I have about 100 record in table, I need to create columns dynamic.
Thanks in advance.
ASKER
>>The table you have is properly structured as far as I can see.
I typed each column, I want generate dynamic, I need add count under each name later,
result like this
ProgramId [ Mary Lee] [John Stall] [Marshall Young]
1 2 3 2
2 4 5 5
I have hundred programs.
I typed each column, I want generate dynamic, I need add count under each name later,
result like this
ProgramId [ Mary Lee] [John Stall] [Marshall Young]
1 2 3 2
2 4 5 5
I have hundred programs.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
The table you have is properly structured as far as I can see.