This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Agile forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Inner Query Execution

 
Guddu Ali
Ranch Hand
Posts: 40
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
select :name from (select empName from Employee);

Suppose the Inner query (select empName from Employee) gives one name 'XYZ'.

And as we know the Inner query and sub query execute first then why we not write directly

select :name from XYZ inplace of writing select :name from (select empName from Employee);
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34084
337
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In this case you would. Inner queries should only be used when they are performing a task that can't be accomplished with a regular simple query.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic