Re: Query to extract one record from multiple records
From: <cbursell_at_geusnet.com>
Date: Tue, 11 Oct 2011 10:21:28 -0700 (PDT)
Message-ID: <0845217d-c059-477a-83d1-ca73523df7ac_at_j15g2000yqc.googlegroups.com>
On Oct 11, 11:10 am, joel garry <joel-ga..._at_home.com> wrote:
> On Oct 11, 7:23 am, cburs..._at_geusnet.com wrote:
>
> > I realize this is a very simplified example for a more complex query.
> > I do not understand how the table creation and data loading commands
> > will help. Am I missing something?
>
> Yes. If it is easy for people to set up a test example, then they can
> try it and play with it rather than guess or ignore it (most will
> ignore it). It also means you can better determine whether your
> simplification makes sense as you see what you haven't told people.
>
> The correct answer is, of course, normalize your design. If for
> whatever reason you are stuck with it, usually a sql answer will be
> the best, although that assumes at least third normal form. If you
> can't do SQL, use PL/SQL. Other languages would be below that. (I'm
> stuck with a 4GL that often fights with oracle, by assuming version
> 7. When I see problem statements like "There will always be at least
> one location which will be either Warehouse or Storeroom." I have to
> question how that is enforced. Enterprise inventory systems will
> often have strange requirements.)
>
> A distinct often leads to a sort, so if it can be avoided, that is
> usually better. The merits of ansi versus oracle style join syntax
> are debatable, but you might want to watch for version-dependent bugs.
>
> jg
> --
> _at_home.com is bogus.http://www.technewsworld.com/story/commentary/73432.html
Date: Tue, 11 Oct 2011 10:21:28 -0700 (PDT)
Message-ID: <0845217d-c059-477a-83d1-ca73523df7ac_at_j15g2000yqc.googlegroups.com>
On Oct 11, 11:10 am, joel garry <joel-ga..._at_home.com> wrote:
> On Oct 11, 7:23 am, cburs..._at_geusnet.com wrote:
>
> > I realize this is a very simplified example for a more complex query.
> > I do not understand how the table creation and data loading commands
> > will help. Am I missing something?
>
> Yes. If it is easy for people to set up a test example, then they can
> try it and play with it rather than guess or ignore it (most will
> ignore it). It also means you can better determine whether your
> simplification makes sense as you see what you haven't told people.
>
> The correct answer is, of course, normalize your design. If for
> whatever reason you are stuck with it, usually a sql answer will be
> the best, although that assumes at least third normal form. If you
> can't do SQL, use PL/SQL. Other languages would be below that. (I'm
> stuck with a 4GL that often fights with oracle, by assuming version
> 7. When I see problem statements like "There will always be at least
> one location which will be either Warehouse or Storeroom." I have to
> question how that is enforced. Enterprise inventory systems will
> often have strange requirements.)
>
> A distinct often leads to a sort, so if it can be avoided, that is
> usually better. The merits of ansi versus oracle style join syntax
> are debatable, but you might want to watch for version-dependent bugs.
>
> jg
> --
> _at_home.com is bogus.http://www.technewsworld.com/story/commentary/73432.html
As you may have guessed, not my design, I have to live with it
I can do it via ODBC and Tcl but was looking for a pure SQL answer as well.
Thanks for the help
Charlie Received on Tue Oct 11 2011 - 12:21:28 CDT