Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Mailing Lists -> Oracle-L -> Re: Any One have any insight?????
Christine,
The developer is just getting one row with each gl_acct_no regardless of
description. If there were two rows with the same gl_acct_no but different
descriptions, both would be fetched otherwise. The "distinct" is actually
unnecessary here. I suspect the developer added that first and when he/she
found duplicates, then added the subquery.
Marc Perkowitz
MTP Systems Consulting
In a message dated 10/5/2000 9:33:03 AM Central Daylight Time, christine.turner_at_ips-sendero.com writes:
<< Good Morning All.....
Listed below is a block of code from a pl\sql procedure that I'm not sure what the developer was trying to accomplish. I know this is easy, but it's one of those "looked at it too long to see the answer" situations. Anyone have any ideas as to why the developer was using rowid in this insert statement????
insert into temp_big_gllist (glacct, desct) select distinct (gl_acct_no), (description) from usrtblname t1 where t1.rowid = (select min(t2.rowid) from v_usrtblname t2 where t1.gl_acct_no = t2.gl_acct_no);
Any comments are appreciated!!!!!
Thanks,
Christine Turner
DBA
IPS Sendero
Received on Thu Oct 05 2000 - 10:10:07 CDT