Click here to Skip to main content
15,886,199 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
i have a table in sql in which column name studentid. and it show like that on run the select query "select * from student" ----

studentid
101
102
103
104


but i want to show it like--

studentid studentid
101 103
102 104


how can i do it..
Posted
Comments
Thomas Nielsen - getCore 8-Apr-14 9:32am    
eh, show that like this where?
Maciej Los 8-Apr-14 12:18pm    
Based on what condition?

1 solution

Basically, you can't: because you don't know in advance how many columns you are going to be splitting it into: what if there are 6 student IDs? 5? 8? How many columns, and how many rows is that?
This kind of manipulation is much, much better done in your presentation software, not in the database.
 
Share this answer
 
Comments
TCS54321 9-Apr-14 1:06am    
roomid seatno classid studentid
1 1 17 101
1 2 18 102
1 3 17 103
1 4 18 104
TCS54321 9-Apr-14 1:10am    
basically i want a print a exam seating plan report. In which if we have 60 student then it split into 10-10 student in 6 column.can it posible..
OriginalGriff 9-Apr-14 4:01am    
And what if you have 70? 30?
Seriously: Do this in your presentation software, not in the database. Databases aren't good at that kind of thing.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900