Embedded Sub Queries

  • Thread starter Thread starter John Ortt
  • Start date Start date
J

John Ortt

Is it possible to embed a subquery in the FROM criteria twice as illustrated
below?

It seems to work once but I can't get it to work when I add the second
embedded query.

(I have simplified the query to get the point across)

SELECT Monkeys
FROM [SELECT Animals AS Monkeys
FROM [SELECT Creature AS Animals
FROM tblZoo] AS qryZoo ] AS qryMyZoo;

If the principle is OK in theory I will try to tweak my query.

Thanks in advance,

John
 
John said:
Is it possible to embed a subquery in the FROM criteria twice as illustrated
below?

It seems to work once but I can't get it to work when I add the second
embedded query.

(I have simplified the query to get the point across)

SELECT Monkeys
FROM [SELECT Animals AS Monkeys
FROM [SELECT Creature AS Animals
FROM tblZoo] AS qryZoo ] AS qryMyZoo;

If the principle is OK in theory I will try to tweak my query.


Theoretically you should be able to do that, but that syntax
does not allow for nested levels of square brackets (even
for field names).
 
Marshall Barton said:
John said:
SELECT Monkeys
FROM [SELECT Animals AS Monkeys
FROM [SELECT Creature AS Animals
FROM tblZoo] AS qryZoo ] AS qryMyZoo;

If the principle is OK in theory I will try to tweak my query.

Theoretically you should be able to do that, but that syntax
does not allow for nested levels of square brackets (even
for field names).

Ok, I was afraid of that......

Thanks Marsh
 
Back
Top