Re: Query to extract one record from multiple records

From: joel garry <joel-garry_at_home.com>
Date: Tue, 11 Oct 2011 09:10:10 -0700 (PDT)
Message-ID: <ed9f5647-8f1f-49e8-9e92-4ed43d71f065_at_v29g2000prd.googlegroups.com>



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
Received on Tue Oct 11 2011 - 11:10:10 CDT

Original text of this message