Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: Can someone optimize this query?

Re: Can someone optimize this query?

From: Carolyn Jane Gillis <cjgillis_at_chorus.net>
Date: Sat, 16 Oct 1999 09:11:51 -0500
Message-ID: <cjgillis-1610990911510001@a3-1.itis.com>


Break down this query to an easier-to-read format, and it appears that you are ORDER BYing your select by BOTH p.last_name {as 3},

                            AND p.last_name {as p.last_name}
It's a minor quibble, and not your main problem, but ...
SELECT DISTINCT p.personid, 
                p.first_name, p.last_name, p.username,
                p.address1, p.address2, p.city, p.state, p.zip, 
                p.company_name, p.phone1, p.fax, p.ref_personid, p2.viewable, 
                nvl((p2.last_modified - p.last_modified), 0) as difference 
FROM     person p, person p2 
WHERE    p.ref_personid = p2.personid(+) 
AND      p.ownerid = 25971 

ORDER BY 3, p.last_name, p.first_name Received on Sat Oct 16 1999 - 09:11:51 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US