Home > Database > Mysql Tutorial > T-SQL 解决"易语言难题"

T-SQL 解决"易语言难题"

WBOY
Release: 2016-06-07 14:56:59
Original
1254 people have browsed it

上班无聊,写着玩玩,不太了解SQL-SERVER,请大家指点。 无 declare @i intdeclare @j intdeclare @str varchar(20)set @i = 123while @i 999/3beginselect @str = convert(varchar,@i) +' '+ convert(varchar,@i*2)+' '+ convert(varchar,@i*3), @j = 1, @i

上班无聊,写着玩玩,不太了解SQL-SERVER,请大家指点。
declare @i int
declare @j int
declare @str varchar(20)
set @i = 123
while @i < 999/3
begin
	select @str = convert(varchar,@i)  +' '+ 
		      convert(varchar,@i*2)+' '+
		      convert(varchar,@i*3), 
		      @j = 1, @i = @i + 1
	while @j <= 9	
	begin
		if charindex(convert(varchar,@j),@str) <= 0 break
		set @j = @j + 1
	end
	if @j >= 10 print @str
end
Copy after login
T-SQL 解决"易语言难题"
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template