解决方案 »
- sqlserver2005远程访问access,并且将数据导入sqlserver如何实现
- 两个数据表的联结
- SQL共享问题
- 请问在网上能下载到SQL SERVER 2000 么?
- 求一SQL语句
- 請高手指教~~~
- 请高手帮忙,怎样建立索引,用来提高这条SQL语句运行速度
- http://topic.csdn.net/u/20090413/11/0b9bd505-4d80-4a04-8581-aee964b01abc.html 我上次的帖子还有点问题
- 怎样把sqlserver数据库传上去?急急急急急急急急急急急急
- 100分求解一个SQL语句的写法,在线等候....
- 求SQL一列的总和
- SQL存储过程批量调用入参数
create table tesst_table
(name varchar(10),yuwen int,shuxue int,yingyu int)insert into tesst_table
select '李大三',50,23,40 union all
select '王小二',50,88,50
select name,
case c when 'yuwen' then '语文'
when 'shuxue' then '数学'
when 'yingyu' then '英语' else '' end 'subject',
v 'score'
from tesst_table a
unpivot(v for c in([yuwen],[shuxue],[yingyu])) u/*
name subject score
---------- ------- -----------
李大三 语文 50
李大三 数学 23
李大三 英语 40
王小二 语文 50
王小二 数学 88
王小二 英语 50(6 row(s) affected)
*/
Incorrect syntax near 'pivot'. You may need to set the compatibility level of the current database to a higher value to enable this feature. See help for the SET COMPATIBILITY_LEVEL option of ALTER DATABASE.
兼容级别不够执行了下:
EXEC sp_dbcmptlevel databaseName,90 OK 了。非常感谢您的帮助!!!