如何将输出拆分为sql查询。 [英] how to split the output to sql query.

查看:85
本文介绍了如何将输出拆分为sql查询。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在sql中有一个表,其中列名为studentid。并且它在运行时显示选择查询select * from student----



studentid

101

102

103

104





但我想要显示它 -



studentid studentid

101 103

102 104





我该怎么办..

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..

推荐答案

基本上,你不能:因为你事先并不知道要将它分成多少列:如果有6个学生ID怎么办? 5? 8?这是多少列,以及有多少行?

这种操作在演示软件中更好,而不是在数据库中完成。
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.


这篇关于如何将输出拆分为sql查询。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆