Only one expression can be specified in the select list when the subquery is not introduced with(求助)
来源:互联网 发布:美工自学 编辑:程序博客网 时间:2024/06/05 09:07
BEGIN TRANdeclare @userName varchar(100)declare @userSurname varchar(100)declare @i intdeclare @num intdeclare @sqlstr nvarchar(1000)declare @error intdeclare @CustomId varchar(100)set @i=1set @num=(select COUNT(*) from (select count(userid) shuliang from dbo.Users group by name,surname having count(userid)>1) as t)set @userName= (select top 1 name from (select top 1 name,surname from dbo.Users group by name,surname having count(userid)>1 order by name ASC) as t order by name desc)set @userSurname=(select top 1 surname from (select top 1 name,surname from dbo.Users group by name,surname having count(userid)>1 order by name ASC) as t order by name desc)set @sqlstr=('select * from User where name="'+CONVERT(varchar(100),@userName)+'" and surname="'+convert(varchar(100),@userSurname)+'" ')set @i=2while @i<=@numbeginset @userName= (select top 1 name from (select top (CONVERT(INT,@i)) name,surname from dbo.Users group by name,surname having count(userid)>1 order by name ASC) as t order by name desc)set @userSurname=(select top 1 surname from (select top (CONVERT(INT,@i)) name,surname from dbo.Users group by name,surname having count(userid)>1 order by name ASC) as t order by name desc)set @sqlstr=@sqlstr+('union select * from User where name="'+CONVERT(varchar(100),@userName)+'" and surname="'+convert(varchar(100),@userSurname)+'" ')print @iprint @sqlstrset @i=@i+1end exec sp_executesql @sqlstrset @error = @@errorif @error <> 0 begin print '查询失败'rollback tran end
- Only one expression can be specified in the select list when the subquery is not introduced with(求助)
- Only one expression can be specified in the select list when the subquery is not introduced with EXI
- An explicit value for the identity column in table 'users' can only be specified when a column list
- The function default must be used with a prefix when a default namespace is not specified
- The function getXX must be used with a prefix when a default namespace is not specified
- The function size must be used with a prefix when a default namespace is not specified
- The function equals must be used with a prefix when a default namespace is not specified
- The function size must be used with a prefix when a default namespace is not specified
- The function equals must be used with a prefix when a default namespace is not specified解决
- 关于The function equals must be used with a prefix when a default namespace is not specified解决
- 关于The function equals must be used with a prefix when a default namespace is not specified解决
- The function getUserId must be used with a prefix when a default namespace is not specified 解决办法
- 关于The function get must be used with a prefix when a default namespace is not specified的错误
- 关于The function size must be used with a prefix when a default namespace is not specified解决
- The specified named connection is either not found in the configuration, not intended to be used
- 'Push segues can only be used when the source controller is managed by an instance of UINavigationC
- Hibernate异常:query specified join fetching, but the owner of the fetched association was not present in the select list
- Why can templates only be implemented in the header file?
- 标准C语言中的预定义宏(部分)
- POJ 1503 Integer Inquiry 高精度加法
- USACO 1.2 Dual Palindromes
- 从U盘安装Ubuntu的最简易方式
- 参加《缺陷管理》培训课程课后笔记
- Only one expression can be specified in the select list when the subquery is not introduced with(求助)
- Linux下查看CPU信息
- JMS与Spring之一(用JmsTemplate同步收发消息)
- java 线程入门
- 日志分析方法概述
- UNICODE 转 UTF8
- mount 挂载第二块硬盘,普通用户可以读写
- ntsd教程
- 研究一下 下载资源年排行