Re: DISTINCT

From: Alexander I. Doroshko <aid_at_grant.kharkov.ua>
Date: 6 May 1999 10:36:33 GMT
Message-ID: <01be97ac$4f2d71e0$190114c1_at_sister.grant.UUCP>


Create a view for your
  SELECT DISTINCT.
[Quoted] If you want to do updates/deletes/inserts in this block, your must write ON-LOCK, ON-UPDATE etc. triggers. Prabhakar Narayanan <prabhakar.narayanan_at_clsasia.com> wrote in article <373135E5.4470A2A6_at_clsasia.com>...
: To my knowledge, you cannot use DISTINCT in the where clause as
ORACLE
But DISTINCT isn't an element of the WHERE clause
: appends the rowid of every record fetched in the database block
If the block is based on a view, empty ROWID is fetched.
: However there is a work around. You have to use UNION in your where
clause
: and forcefully stop the 1st query fetching records, for instance you
can
: specify
:
: SELECT COL1, COL2, COL3, rowid (oracle will append rowid)
: FROM TABLE 1
: WHERE 1 = 2 (one will never be equal to 2, hence the 1st select will
fail)
:
: UNION
:
: SELECT DISTINCT COL1, COL2, CHARTOROWID('a')
: FROM TABLE 2
: ..
: ..
:
: (the above query will return your desired values)..
:
: Union will expect all the columns to be of same data type. Therefore
you
: have to use CHARTOROWID of a constant (in our example 'a') and
proceed with
: our logic
:
: Hope this helps

If your create a view from your query, it'll work, but the complications
are void.
: Regards
:
: N.Prabhakar
:
:
: Markus Schwabe wrote:
:
: > How do I make a DISTINCT -Clause in my Base-Table-Block?
: >
: > SELECT DISTINCT columns FROM table....
: > <skipped>
Received on Thu May 06 1999 - 12:36:33 CEST

Original text of this message