Home » SQL & PL/SQL » SQL & PL/SQL » Query approach (Oracle 9i/10g)
Query approach [message #339293] Thu, 07 August 2008 04:10 Go to next message
Olivia
Messages: 519
Registered: June 2008
Senior Member
Want to know which one is feasible from optimization perspective?
select b.trace_loc_cd trace_loc_cd, b.prod_cd, b.dest_location_cd
    from item a, order b
    where a.type_id = in_type_id
    and a.product_req_item_id = b.order_item_id
    order by b.t_loc_cd 


				
select b.trace_loc_cd trace_loc_cd , b.prod_cd, b.dest_location_cd
    from  order b where
			(in_case_id,b.order_item_cd) in ( select a.type_id,a.product_req_item_cd from item a)
             order by b.trace_loc_cd 



Thanks in adavnce,
Regards,
Oli

[Updated on: Thu, 07 August 2008 04:24]

Report message to a moderator

Re: Query approach [message #339305 is a reply to message #339293] Thu, 07 August 2008 04:41 Go to previous messageGo to next message
Olivia
Messages: 519
Registered: June 2008
Senior Member
Want to know which one is feasible from optimization perspective?
Which approach woul be feasible?

Need your help!

Regards,
Oli
Re: Query approach [message #339308 is a reply to message #339305] Thu, 07 August 2008 04:44 Go to previous messageGo to next message
Michel Cadot
Messages: 68711
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator
What do you mean "feasible"?

From my synonym dictionary: feasible is achievable, attainable, conceivable, doable, imaginable, likely, possible, practicable, practical, thinkable, viable, workable. Which one for you?

Regards
Michel
Re: Query approach [message #339310 is a reply to message #339308] Thu, 07 August 2008 04:46 Go to previous messageGo to next message
Olivia
Messages: 519
Registered: June 2008
Senior Member
Michel Cadot wrote on Thu, 07 August 2008 04:44
What do you mean "feasible"?

From my synonym dictionary: feasible is achievable, attainable, conceivable, doable, imaginable, likely, possible, practicable, practical, thinkable, viable, workable. Which one for you?

Regards
Michel




Best approach...
Re: Query approach [message #339337 is a reply to message #339310] Thu, 07 August 2008 05:31 Go to previous messageGo to next message
Michel Cadot
Messages: 68711
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator
As for your previous question, Oracle is smart to rewrite your query to the most efficient form when they are equivalent.

For myself, I tend to use the second form when I don't need the values from the second table in the select list.

Regards
Michel
Re: Query approach [message #339338 is a reply to message #339337] Thu, 07 August 2008 05:33 Go to previous message
Olivia
Messages: 519
Registered: June 2008
Senior Member
Quote:

For myself, I tend to use the second form when I don't need the values from the second table in the select list.


I got the answer


Thanks,
Oli
Previous Topic: getting variable's size runtime ? is it possible in pl/sql
Next Topic: Cursor select
Goto Forum:
  


Current Time: Sun Nov 10 06:42:04 CST 2024