-3

When a query is completed and executed, query execution errors are sometimes encountered as shown below.

ERROR: subquery in FROM must have an alias
LINE 2: from (
^
HINT: For example, FROM (SELECT ...) [AS] foo.

What's the difference between writing a "as foo" in the subquery and not writing it?

Phil
  • 157,677
  • 23
  • 242
  • 245
  • 2
    Please put a [Minimal, Complete, and Verifiable](https://stackoverflow.com/help/mcve) example in the question itself. – Rajesh Pandya Nov 22 '18 at 05:32
  • 3
    Possible duplicate of [subquery in FROM must have an alias](https://stackoverflow.com/questions/14767209/subquery-in-from-must-have-an-alias) – Phil Nov 22 '18 at 05:37
  • Simply because its a derived table, not all DB require this. It doesnt matter if you add the `as` or not, *but* it has to be named in sql (because its enforced) even if you are not using it... – Trevor Nov 22 '18 at 05:40

1 Answers1

1

## Your Query should be like this ##

 Select * from (Select * from tblTest) V --V is an alias