首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > asp.net >

sql语句求救解决思路

2012-01-01 
sql语句求救我用sql语句查询的出结果如下:1追求卓越1test11追求卓越2test21追求卓越3test32积极进取1test4

sql语句求救
我用sql语句查询     的出结果如下:
1   追求卓越   1   test1
1   追求卓越   2   test2
1   追求卓越   3   test3
2   积极进取   1   test4
2   积极进取   4   test5
2   积极进取   5   test6

我想得到如下结果:
1   追求卓越   1   test1
                      2   test2
                      3   test3
2   积极进取   1   test4
                      4   test5
                      5   test6

  请问SQL语句应该怎么写呢,有思路吗 多谢

有没有相似的例子列举一个 谢谢




[解决办法]
看不出什么规律
[解决办法]
帮忙顶
[解决办法]
1 追求卓越 1 test1
2 test2
3 test3
2 积极进取 1 test4
4 test5
5 test6
这么写是什么意思,
让 2 test2
3 test3
的第一列没有值吗?
[解决办法]
你倒是可以把这条语句放入临时表,然后加一条语句 update 一下
select c1,c2,c3,c4 into #temp from yourtable
update #temp
set c1= ' ', c2 = ' '
where c3= '1 '

热点排行