Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SQL

how to use select union and loop

CREATE TABLE #Temp
(
  <COLUMNS>
)

 DECLARE @position INT
 SET @position = -1

 WHILE(@position < 1)
 BEGIN

    INSERT INTO #Temp (<COLUMNS>)
    SELECT * FROM mytable

    SET @position = @position + 1

 END

 SELECT * FROM #Temp
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #select #union #loop
ADD COMMENT
Topic
Name
7+3 =