求sql语句

daring1981 2008-09-17 10:59:30
1 2 3 4 5
--------------
a
b
c
d
c
5条记录
查询为
1 2 3 4 5
--------
a b c d e
sql怎么写
...全文
86 4 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
  • 打赏
  • 举报
回复
这样的题目不伦不类
lff642 2008-09-17
  • 打赏
  • 举报
回复
hsie168518 2008-09-17
  • 打赏
  • 举报
回复
能不能详细点?
dawugui 2008-09-17
  • 打赏
  • 举报
回复
select tb1.col1,tb2.col2,tb3.col3,tb4.col4,tb5.col5 from
(select col1 , px = (select count(1) from tb where col1 <> '' and col1 > t.col1) from tb t where col1 <> '') tb1,
(select col2 , px = (select count(1) from tb where col2 <> '' and col2 > t.col2) from tb t where col2 <> '') tb2,
(select col3 , px = (select count(1) from tb where col3 <> '' and col3 > t.col3) from tb t where col3 <> '') tb3,
(select col4 , px = (select count(1) from tb where col4 <> '' and col4 > t.col4) from tb t where col4 <> '') tb4,
(select col5 , px = (select count(1) from tb where col5 <> '' and col5 > t.col5) from tb t where col5 <> '') tb5
where tb1.px = tb2.px and tb1.px = tb3.px and tb1.px = tb4.px and tb1.px = tb5.px

34,838

社区成员

发帖
与我相关
我的任务
社区描述
MS-SQL Server相关内容讨论专区
社区管理员
  • 基础类社区
  • 二月十六
  • 卖水果的net
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧