| 
		
			| Inner Sub Queries [message #199814] | Thu, 26 October 2006 05:54  |  
			| 
				
				
					| miroconnect@yahoo.com Messages: 202
 Registered: April 2006
 | Senior Member |  |  |  
	| I have confusion with inner queries. Suppose I have two table
 first table:  as_events
 cols are event_id, event_alias, display names
 second table: as_trails:
 cols are trail_id,event_id,object_id,user_id,date
 
 
 Here is the query
 
 (select * from as_event)event,
 (select * from as_trail) trail
 where event.evevnt_id=trail_event_id
 
 
 Here is query with the same output as above but without inner queries
 
 select from event.*,trail.* from as_event event ,as_trailtrail where event.event_id=trail_trail_id
 
 
 I confused which is the better approach and why?
 Thanks & Regards
 miro
 |  
	|  |  | 
	| 
		
			| Re: Inner Sub Queries [message #199829 is a reply to message #199814] | Thu, 26 October 2006 07:08   |  
			| 
				
				
					| Frank Messages: 7901
 Registered: March 2000
 | Senior Member |  |  |  
	| | miroconnect@yahoo.com wrote on Thu, 26 October 2006 12:54 |  | Here is query with the same output as above but without inner queries 
 select from event.*,trail.* from as_event event ,as_trailtrail where event.event_id=trail_trail_id
 
 
 | 
 Same output as in both get a missing expression error?
 |  
	|  |  | 
	| 
		
			| Re: Inner Sub Queries [message #199836 is a reply to message #199814] | Thu, 26 October 2006 07:27  |  
			| 
				
				|  | Kevin Meade Messages: 2103
 Registered: December 1999
 Location: Connecticut USA
 | Senior Member |  |  |  
	| I think you terminology is a bit off. 
 First, you are missing the * as in "select *...".  That is the cuse of the missing expression.
 
 Second, both these queries are the same.  Inner join is really a poor name of to begin with (I never liked it).  In any event, in most situations, these queries will execute the same way because Oracle will do the necessary rewrite to make them the same.  Indeed, semantically they mean the same thing.
 
 I wouldn't put too much emphasis on the term "inner join", it isn't used that much, except that some bean counter couldn't handle the fact that we had an "outer join", so there must be something called an "inner join".  I suppose so.
 
 Good luck, Kevin
 |  
	|  |  |