Re: tool: convert classic oracle sql to ansi?
Date: Fri, 19 Dec 2008 12:52:52 -0800 (PST)
Message-ID: <fd60d07b-82ef-4240-a4b9-9a9ff712ae7d@g1g2000pra.googlegroups.com>
On Dec 19, 3:33 pm, DA Morgan <damor..._at_psoug.org> wrote:
> kooroori..._at_gmail.com wrote:
> >> And that is worth your time and your employer's money?
Typical mis direction from Captain Morgan here ...
> >> And one is clearer than the other?
> >> I'd love to hear the explanation.
A better question ...
Poster replies
> > I think it is clearer as it better separate joins from selection
> > criteria
Possibly a valid point to some people ... I will give you that. Poster is asserting their opinion.
Then Captain Morgan jumps in with the pontificating and the posing ...
> And this is important to a trained professional for what reason?
> If you can't read:
>
> WHERE t1.x = t2.x
>
> you are in the wrong profession.
>
> and find it easier to spot missing joins which a few
>
> > developers [and myself] tend to do using the old syntax with complex
> > queries
>
> Which indicates to me that your training needs to be improved not that
> every query needs to be rewritten which is far more expensive especially
> when you add in a full testing cycle.
>
> - killing dev with a cross join in the process. So for me we
>
> > save time/$$ by less errors and rework. For simple queries it is a bit
> > of a trade off.
>
> This isn't about you this is about your employer. And one week of
> training, at most a few thousand dollars, is a lot cheaper than
> rewriting and retesting working code.
>
> If a little thing like classic Oracle vs ANSI joins has you in a twist
> what are you going to do when you see something like this?
>
> SELECT num_rows, index_name
> FROM (SELECT table_name, num_rows FROM user_tables) a,
> (SELECT index_name, table_name FROM user_indexes) b
> WHERE a.table_name = b.table_name(+);
>
> or this:
>
> WITH qb1 AS
> (SELECT inst_id FROM gv$session),
> qb2 AS
> (SELECT unique inst_id FROM qb1
> UNION ALL
> SELECT unique inst_id FROM qb1)
> SELECT /*+ MATERIALIZE */ *
> FROM qb1, qb2
> WHERE qb1.inst_id = qb2.inst_id;
>
> or this:
>
> SELECT srvr_id
> FROM (
> SELECT srvr_id, SUM(cnt) SUMCNT
> FROM (
> SELECT DISTINCT srvr_id, 1 AS CNT
> FROM servers
> UNION ALL
> SELECT DISTINCT srvr_id, 1
> FROM serv_inst)
> GROUP BY srvr_id)
> WHERE sumcnt = 2;
> --
> Daniel A. Morgan
> Oracle Ace Director & Instructor
> University of Washington
> damor..._at_x.washington.edu (replace x with u to respond)
> Puget Sound Oracle Users Groupwww.psoug.org
Looks like the typical spamming of the newsgroup here Received on Fri Dec 19 2008 - 14:52:52 CST