How to select records in the duplicate and two copies lines no rows

Hello

I'm working on Oracle with the following details
Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - 64 bit Production
With partitioning, OLAP and Data Mining options

I need help to choose one of the duplicate records and a few duplicate not based on condition. I wrote the script that only gives me one of the record list duplicate, but I'm confused how select duplicate duplicates.

My condition is to select all records where TARGET TABLE AND TARGET_COLUMN IS NOT NULL. I need to select unique records of this this condition based on these attributes only Anwar. _

_ From the SOURCE

TARGET_TABLE TARGET_COLUMN SRC_COLUMN
-----
--------------------
-----
SRC_EXTERNAL SUBJECT_AREA SUBJECT_AREA
FISCAL_YEAR FISCAL_YEAR SRC_EXTERNAL
PARTY_ID_ORG PARTY_ALT_ID PARTY_ID
PARTY_ID_NEW PARTY_ALT_ID PARTY_ID
ESTABLISHMENT_NBR_ORG W2_EMPLOYER ESTABLISHMENT_NBR
ESTABLISHMENT_NBR_NEW W2_EMPLOYER ESTABLISHMENT_NBR
EMPLOYMENT_CODE_ORG W2_EMPLOYER EMPLOYMENT_CODE
EMPLOYMENT_CODE_NEW W2_EMPLOYER EMPLOYMENT_CODE
SICK_PAY_IND_ORG W2_EMPLOYER SICK_PAY_IND
SICK_PAY_IND_NEW W2_EMPLOYER SICK_PAY_IND
AGENT_IND_CODE
AGENT_FEIN
EMPLOYER_NAME
EMPLOYER_ADDRESS
CLIENT_ADDRESS
CITY
STATE
ZIP

_ REQUIRED TARGET

TARGET_TABLE TARGET_COLUMN SRC_COLUMN

-----
--------------------
-----
SICK_PAY_IND_NEW W2_EMPLOYER SICK_PAY_IND
EMPLOYMENT_CODE_NEW W2_EMPLOYER EMPLOYMENT_CODE
ESTABLISHMENT_NBR_NEW W2_EMPLOYER ESTABLISHMENT_NBR
PARTY_ID_NEW PARTY_ALT_ID PARTY_ID
SRC_EXTERNAL SUBJECT_AREA SUBJECT_AREA
FISCAL_YEAR FISCAL_YEAR SRC_EXTERNAL

MY QUERY_ +.


SELECT NOMFICHIER_SRC, TARGET_TABLE, SRC_COLUMN, TARGET_COLUMN
OF ITS_STAGE. STG_EDW_METADATA X
WHERE TARGET_TABLE IS NOT NULL AND TARGET_COLUMN IS NOT NULL
AND ROWID & gt; (SELECT MIN (ROWID)
OF ITS_STAGE. STG_EDW_METADATA Y
WHERE TARGET_TABLE IS NOT NULL AND TARGET_COLUMN IS NOT NULL
AND Y.TARGET_TABLE = X.TARGET_TABLE
AND Y.TARGET_COLUMN = X.TARGET_COLUMN)



MY RESULTS+ _
TARGET_TABLE TARGET_COLUMN SRC_COLUMN

-----
--------------------
-----
SICK_PAY_IND_NEW W2_EMPLOYER SICK_PAY_IND
EMPLOYMENT_CODE_NEW W2_EMPLOYER EMPLOYMENT_CODE
ESTABLISHMENT_NBR_NEW W2_EMPLOYER ESTABLISHMENT_NBR
PARTY_ID_NEW PARTY_ALT_ID PARTY_ID

Can some Oracle expert please help me solve this problem.

Thanks in advance

Rajesh

Published by: user532468 on 15 Sep, 2008 14:32

With the help of

AND ROWID * > * (SELECT MIN (ROWID)

you select duplicates. Just change of

AND ROWID * = * (SELECT MIN (ROWID)

This will select everyring but duplicates. However, it is not effective. All you need is:

SELECT SRC_FILENAME,SRC_COLUMN,TARGET_TABLE, TARGET_COLUMN
FROM (SELECT DISTINCT * FROM  ITS_STAGE.STG_EDW_METADATA X
WHERE TARGET_TABLE IS NOT NULL AND TARGET_COLUMN IS NOT NULL)

SY.

Tags: Database

Similar Questions

Maybe you are looking for

  • Sierra upgrade - NO speaker sound

    After upgrading my MacBook Pro [13'3 inches, mid-2012] of El Capitan for Sierra my internal speakers stoped working and helmets as well listening. The only way I can use the sound is through Apple TV... Reinstalled Sierra, ran disk utility, checked h

  • Where is the version for 64-bit Linux?

    When I go to the download page for Linux, it has just the 32-bit version. Of course, I'm on Linux 64-bit so I do not want to turn Firefox 32 bit.

  • After installation of El Capitan, evil library selected.  What can I do to get my library active to show when I opened the Photos?

    After installing El Capitan on my iMac (20-inch early 2008), I have selected the wrong library to update and can appear not to understand how to fix this problem.  I can get to the old library of photo, but when I then click the iPhoto icon, the wron

  • A369i displaying not a name for incoming calls

    I bought an A369i a few months ago. It worked all fine, but now, ILA does not display contact names, number only. I tried to save format + 91 contact no.s and not starting with 0, but don't work. I also deleted all the data of the phone app, but even

  • File isus.msi

    Windows XP Home SP3 - Windows Installer continues to appear and go then to Manager day. Finally, it gets to the point where the computer wants a drive and finally issues a 1706 error. The file of any computer is looking is isus.msi. Does anyone know