Discussion:
Interpreter supports single select
(too old to reply)
Jack Brosch
2016-02-19 16:08:41 UTC
Permalink
I'm working through a SQL interpreter that only allows one outer select command (sub-queries / unions are supported) and I'm trying to work around this ... any suggestions?

-- Works
Select *
INTO TempJack
FROM Sales.Customer

Select *
From TempJack



-- Doesn't work
SELECT * FROM
(
SELECT *
INTO TempJack
FROM Sales.Customer
)
Erland Sommarskog
2016-02-19 20:44:26 UTC
Permalink
Post by Jack Brosch
-- Doesn't work
SELECT * FROM
(
SELECT *
INTO TempJack
FROM Sales.Customer
)
You can only use the INTO clause in the outermost SELECT, so the above is
not legal. On top of that, you need an alias for the derived table.

SELECT * INTO TempJack FROM
(
SELECT *
INTO TempJack
FROM Sales.Customer
) AS c
--
Erland Sommarskog, Stockholm, ***@sommarskog.se
Loading...