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: How do I select distinct values when user executes query?

Re: How do I select distinct values when user executes query?

From: John Smithy <me_at_me.com>
Date: Thu, 22 Jul 1999 11:47:54 GMT
Message-ID: <379a04e2.62188113@news.ikea.com>


Hi Randy,

Thanks. I really don't have alot of data in this table. It is basically a temporary holding place.

I know about DISTINCT, but I don't know where to put it. When the user hits the execute query, the first ship_no and its details populate the screen. My problem is that if a particular ship_no has many rows and the user hits the next record button, he/she won't see anything happen. If there is only one row for this ship_no, then the next ship_no and its details will appear when the next record button is pressed.

Also, when the detail blocks get filled in, I get some duplication. So I want to use DISTINCT, but don't know how to modify the default QUERY_MASTER_DETAILS program unit that Forms 5 uses for master-detail relations.

Thanks,
John

On Wed, 21 Jul 1999 19:46:16 -0400, Randy DeWoolfson <randy_at_euclidsys.com> wrote:

>Hey John.
>
>Usually, 'a single table with all your data' isn't the optimal solution.
>
>if you can logically 'divide this table into three blocks', then I bet
>you
>can physically divide that same table into 3 tables.
>
>when you do this, the SHIP_NO will most likely be a unique key in
>one of the tables. when this is true, then a simple select will return
>all
>the unique values.
>
>if you can not break up the mega-table into smaller ones, then look up
>the DISTINCT keyword.
>
>good luck
>randy
>
>John Smithy wrote:
>
>> Hi,
>>
>> I know this is probably dumb. I have a single table with all my data.
>> One column is called ship_no. For each ship_no, there are many
>> rows. So when a user queries on this, he/she will see many rows
>> for each ship_no. I have this table divided into three blocks. The
>> master block just has ship_no. The details are in the other blocks.
>> The user will query on ship_no. I only want to display the unique
>> value. Can someone help me out? I am a new Oracle Developer.
>> I am coding with Forms 5.0
>>
>> Thanks,
>> John
Received on Thu Jul 22 1999 - 06:47:54 CDT

Original text of this message

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