How to find duplicate colums in a table?
i have a table product_info with a data in the following format.
product_id catalog_id product_info_id
aaaa bbbb xyz
dddd cccc rrr
aaaa bbbb kkk
ffff gggg ttt
dddd cccc eee
now when i select the table i want to display only the duplicate records for column product_id and catalog_id.
The result should be in the following format
product_id catalog_id product_info_id
aaaa bbbb xyz
dddd cccc rrr
aaaa bbbb kkk
dddd cccc eee
Thank you all for your help in advance.
select *
from product_info x
where x.rowid >
(select min(rowid)
from product_info y
where y.product_id = x.product_id
and y.catalog_id = x.catalog_id
Sybrand Bakker
Senior Oracle DBA
Similar Messages
-
How to find latest entry in the table according to time
how to find latest entry in the table according to the time
is there any function module to do so
\[removed by moderator\]
Regards
Shashi
Edited by: Jan Stallkamp on Aug 25, 2008 4:39 PMHi,
If you want to read the entry from an internal table,
sort the internal table in the descending order by the time and
delete adjacent duplicates by comparing the fields other than time and the internal table will have the latest record.
Suggestion: instead of only time try to have one more field called date with the time combination
Regards,
Ramesh -
How to find Transaction for a Known Table maintenance View
Hello Friends,
May I know how to find transaction for a known table maintenance View.
Thanks,
Best Regards,
Sudhanshu GargGoto SE16 Transaction and enter TSTCP Table
Here PARAM = /SM30 VIEWNAME=Table name*;UPDATE=X;
enter table name in bold.
Thanks
Seshu -
How to find the list of existing tables in a schema using DB link?
Hi
I know how to find the list of existing tables in a schema using the following query
SQL> select * from tab;
but, how to list the tables using a DB link?
For Example
SQL> select * from tab@dblink_name;
why this doesn't work?
Pl advice me
Thanks
Reddy.ORA-02019: connection description for remote database not foundHave you used this database link successfully for some other queries?
The error posted seems to indicate that the DB Link is not functional at all. Has it worked for any other type of DML operation or is this the first time you ever tried to use the link? -
How to find out the Non Partitioned Tables used 2Gb on oracle
Hi team
how to find out the Non Partitioned Tables used > 2Gb on oracle where not is sys & system
regardsheres 1 I made earlier
set pagesize 999
set linesize 132
col owner format a25
col segment_name format a60
select owner,segment_name,segment_type,(bytes/1024/1024)"MB size"
from dba_segments
where owner not in ('SYS','SYSTEM','XDB','MDSYS','SYSMAN') -- edit for taste
and segment_type = 'TABLE'
having (bytes/1024/1024) > 2000
group by bytes, segment_Type, segment_name, owner
order by 4 asc -
How to find the column name and table name with a value
Hi All
How to find the column name and table name with "Value".
For Example i have value named "Srikkanth" This value will be stored in one table and in one column i we dont know the table how to find the table name and column name
Any help is highly appricatable
Thanks & Regards
Srikkanth.M2 solutions by Michaels (the latter is 11g upwards only)...
michaels> var val varchar2(5)
michaels> exec :val := 'as'
PL/SQL procedure successfully completed.
michaels> select distinct substr (:val, 1, 11) "Searchword",
substr (table_name, 1, 14) "Table",
substr (t.column_value.getstringval (), 1, 50) "Column/Value"
from cols,
table
(xmlsequence
(dbms_xmlgen.getxmltype ('select ' || column_name
|| ' from ' || table_name
|| ' where upper('
|| column_name
|| ') like upper(''%' || :val
|| '%'')'
).extract ('ROWSET/ROW/*')
) t
-- where table_name in ('EMPLOYEES', 'JOB_HISTORY', 'DEPARTMENTS')
order by "Table"or
SQL> select table_name,
column_name,
:search_string search_string,
result
from cols,
xmltable(('ora:view("'||table_name||'")/ROW/'||column_name||'[ora:contains(text(),"%'|| :search_string || '%") > 0]')
columns result varchar2(10) path '.'
where table_name in ('EMP', 'DEPT')
TABLE_NAME COLUMN_NAME SEARCH_STRING RESULT
DEPT DNAME ES RESEARCH
DEPT DNAME ES SALES
EMP ENAME ES JONES
EMP ENAME ES JAMES
EMP JOB ES SALESMAN
EMP JOB ES SALESMAN
EMP JOB ES SALESMAN
EMP JOB ES PRESIDENT
EMP JOB ES SALESMAN
9 rows selected. -
How to find function module's and tables used for the particulat screen or TCODE?
Hello Nation,
I would like to know how to find the function modules and tables used for the particular screen or TCODE or program.
Example : I would like know the function module used in the program RDBGFT?
How can i find that?
Thanks in advance ,Awaiting your reply.Make use of Find function with the keyword "CALL FUNCTION".
Make use of the same find function with the keyword "Select" to know the database tables used.
Regards,
Philip. -
How to find duplicates in aperture
How to find duplicates in aperture
Aperture has no tool to search and remove duplicates. It relies on the option "Do not import duplicates", when you import images to Aperture.
To identify duplicates search for them manually by sorting images by date or filename, or use third party tools.
See Old Toad's list in the pos below: Most of the apps work also for Aperture:
Re: iPhoto not asking about duplicates on importing
i am using PhotoSweeper .It can also identify duplicates in different resolutions or edited duplicates, and lets you control the rules for marking a photo for removal - the newer one, the smaller one, the one without captions or keywords, etc. -
How to find global index in partition table
Hi guys ,
need one help
How to find global index on partition table
How to find local index on partition table
Need query
Thanks in advance
Edited by: nav on Feb 17, 2012 6:51 AMnav wrote:
Hi Solomon,
so I have to identify partition & index are created or not,
also I have check the status of index ( both global and local)So what's the problem? Table/index partition is an object, so you can query DBA_OBJECTS:
SELECT SUBOBJECT_NAME,
CREATED
FROM DBA_OBJECTS
WHERE OWNER = partitioned-table-owner
AND OBJECT_NAME = partitioned-table-name
AND CREATED >= TRUNC(SYSDATE)
/This will give you partitions created today. So if you run this right after your job (I hope your job doen't run too close to midnight), you'll get table partition name your job created. Same logic can be applied to indexes.
SY. -
How to find duplicates in bods
how to find duplicates in bods
Hi Kishore refer this documents:
http://wiki.scn.sap.com/wiki/display/EIM/DQ+Match+Transform
http://wiki.scn.sap.com/wiki/display/EIM/Comparison+with+detect+duplicates
SAP MDM Integration with Business Object Data services (BODS) To provide Single Version Of Truth -
How to check duplicate entries in internal table??
Dear Friends,
How to check duplicate entries in internal table??
Exp: In my internal table if I am having the same records more then ones then I need to print the error message, here I am using steploop for selecting the values from screen, and the values are coming into my internal table if user enter the same value more then ones I need to print the error message.
Thanks,
SridharHi,
After storing the data into internal table say ITAb, move the data into another internal table.
t_dup[] = itab[].
LOOP AT itab.
count1 = count1 + 1.
itab-count1 = count1.
MODIFY itab.
ENDLOOP.
LOOP AT t_dup.
count2 = count2 + 1.
t_dup-count2 = count2.
MODIFY t_dup.
ENDLOOP.
DELETE ADJACENT DUPLICATES FROM itab.
LOOP AT t_dup.
record_dup = 'N'.
READ TABLE itab WITH KEY count1 = t_dup-count2.
IF sy-subrc = 0.
record_dup = 'Y'.
ENDIF.
IF record_dup NE 'Y'.
t_dup-message = 'DUPLICATE ENTRY'.
t_dup-flag = 1.
MODIFY t_dup.
ENDIF.
ENDLOOP.
Use this sample code.
Reward pts if it is helpfull.
Regards
Srimanta -
How to find the deleted data in tables
guys,
how to find the deleted data in tables example: i want to see whether anyone deleted data in MB5B report tables like mbew, etc.,
regards,Hi,
MBEWH is actually the history table of MBEW. It will record all the changes. As I have told you earlier if you have deleted the record dirctly from the table then it will not come even in the table MBEWH
That means no changes have been made.
regards -
How to find which datasource are using tables AFRU ,CAUFV and AUFM
*how to find which datasource are using tables AFRU ,CAUFV and AUFM*
Hi,
You can enter your table names in SE11 transaction and click "Display" and again click "Where -Used-List". Then it will show all the places where these tables are used(Datasources)
Hope this helps.....
Regards,
SUman -
How to find duplicate files in Finder with Automator or Apple ScriptEditor
Can anyone tell me how to find duplicate files in Finder with Automator or Apple ScriptEditor.
D'oh! It's actually fairly easy - I just right clicked on the file, Get Info, Artwork tab, then dragged the picture to the desktop, from where I can do what I like with it. Never mind, nothing to see here, carry on.
-
How do I duplicate or copy a table onto the same page?
In Pages, how do I duplicate or copy a table onto the same page?
option drag duplicates anything or copy and paste
Peter
Maybe you are looking for
-
Me59 automatic cration of po from requstion
hi gurus how i create automatic cration of po from requstion(me59)? what i enter in that fields. thx in advance
-
Would this query be faster in Oracle 10?
I'm running 2 queries on Oracle 8i: Query 1: select count(Member_ID) from select Member_ID, c2, c3, ... c100 from T1 union select Member_ID, c2, c3, ... c100 from T2 union union select Member_ID, c2, c3, ... c100 from T10 Query2: select count(Member_
-
How do I disable the Plugin Update tab when I start Firefox?
Whenever I start Firefox, a second tab entitled "Plugin Update" opens. I do not recall enabling it anywhere, and I would like to disable it, but I do not know how. Might you be able to point me in the right direction?
-
Initally was able to connect N72 to PC now not con...
Hi all, I am using N72. I have installed all relevant cable drivers .For few days it was working fine, i was able to able to connect and transfer the data . But today when i tried to connect ,its not detecting my Phone by so? Thanks in advance, Any s
-
Display crashed - 2008 iMac running Windows 7
Hi there, I have a later 2008 iMac running Windows 7 on an Nvidia 8800gt. I've been using the Windows side only for playing games, and have been doing so for about a year now. Everything has worked fine until today running Far Cry 2. The display star