易截截图软件、单文件、免安装、纯绿色、仅160KB

sql 简单查询求助 - MS-SQL Server / 疑难问题

数据内容

no name
-----------
x1 wade
2d james
pk kobe
aa KG


希望结果为


no name no name
-------------------------
x1 wade 2d james
px kobe aa KG



SQL code:
create table tb (no varchar(5),name varchar(10))
insert tb
select 'x1', 'wade' union all
select '2d', 'james' union all
select 'pk', 'kobe' union all
select 'aa', 'KG'

select max(no1) no ,max(name1) name,max(no2) no ,max(name2) name from
(
select (row_number()over(order by getdate())-1)/2 rn,
(case when row_number()over(order by getdate())%2=1 then no else '' end) no1,
(case when row_number()over(order by getdate())%2=1 then name else '' end) name1,
(case when row_number()over(order by getdate())%2=0 then no else '' end) no2,
(case when row_number()over(order by getdate())%2=0 then name else '' end) name2
from tb
) t
group by rn

/*
no name no name
----- ---------- ----- ----------
x1 wade 2d james
pk kobe aa KG

(所影响的行数为 2 行)

*/



具体里面有多少记录是未知的


学习中

引用
具体里面有多少记录是未知的

那些测试语句你不用管.只需要这3句:

select * , id=identity(int,1,1) into tmp from tb


相关问答:

csv文件转换成sql导入到数据库,没有数据为何?

执行的顺序:
1)文件浏览框(选择文件使用)
选择好文件后
点击一个导入按钮的时候 ,把上面上传框里的csv文件以一个ID为文件名,上传到**/**文件夹下
2)读取这个文件夹下的csv的文件,转换成sql
3 ......

jsp链接sql2000的疑问?



type Exception report


message

description The server encountered an internal error () that prevented it from fulfilling this request.

exception

org.apache.jas ......

sql - MS-SQL Server / 疑难问题

sql的软件在哪里可以下啊!在网上找了蛮多都用不了啊

随便搞一D版吧,

迅雷第一个就可以用
2000,2005都这样

http://119.147.41.16/down?cid=0698C2D64D7D637D90A6D2482298E6717D4F15CD&t=2&fmt=-1 ......

求一SQL - MS-SQL Server / 基础类

tab1 字段:billdate,goodsid,incount,inmoney,outcount,outmoney,endprice,endcount,endamt
tab2 字段:goodsid,goodskind(商品类型)
tab3 字段:goodskind(商品类型),kindname
结果:
得到商品类型在一段时间 ......

C# SQL 的UPDATETEXT 问题 - .NET技术 / C#

A表 有两个字段 
  id 唯一数字域
  InfoTxt text 类型
 我现在要把 id 不是14 的所有 InfoTxt字段 文本后面 都加上 'aaa' 
按下面执行下来 只有表最后一行加上了 'aaa' ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号