Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Simple SQL quetsion

Re: Simple SQL quetsion

From: Bill Bearden <bbearden_at_quincy.glenayre.com>
Date: 1997/06/12
Message-ID: <01bc7737$75493590$1d51e69d@qcy_erp_6>#1/1

A true primary key can't be null. If this is truly a primary key, select count(*) should be the same as selecting count(distinct primary_key).

Here is one way to check for distinct composite key...

select count(distinct to_char(organization_id) + to_char(inventory_item_id)) k

        from inv.mtl_system_items;

Bill Bearden
Consultant
Nimrod Oren <orenn_at_inter.net.il> wrote in article <339F1A31.3242EF0_at_inter.net.il>...
> I'm using the rule-based optimizer and I try to get the number of
> records from a table with a composite primary-key.
> Select count(*) does a full table scan. Is there a way to count the
> occurrences of the primary key (hopefully without hints)?
>
>
  Received on Thu Jun 12 1997 - 00:00:00 CDT

Original text of this message

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