Sql 多次重复从select语句获取的数据块
1我有以下疑问Sql 多次重复从select语句获取的数据块,sql,repeat,Sql,Repeat,1我有以下疑问 select CRESTACode,Latitude,Longitude from airgeography..tgeography where countryname in ( 'St. Maarten') and crestacode is not Null 结果: CRESTACode Latitude Longitude 6 18.035187 -63.076599 如何多次重复此数据以在一个表中获得3000行相同的数据?尽管这
select CRESTACode,Latitude,Longitude from airgeography..tgeography where countryname in (
'St. Maarten') and crestacode is not Null
结果:
CRESTACode Latitude Longitude
6 18.035187 -63.076599
如何多次重复此数据以在一个表中获得3000行相同的数据?尽管这可能会很昂贵:
DECLARE @InsertNum INT
SET @insertnum = 3000
select CRESTACode,Latitude,Longitude
INTO #tablex
from airgeography..tgeography
where countryname in ('St. Maarten')
and crestacode is not Null
WHILE (@InsertNum <> 0 )
BEGIN
INSERT INTO #Tablex
SELECT CRESTACode,Latitude,Longitude
FROM Tablex;
SET @insertNum = @InserTNum - 1
Print @InsertNum
END
SELECT * FROM #tablex
你用什么数据库?SQL,我用SSMSDuplicate做这个?