Deleting Duplicate Rows in a list
Hey folks, I've scowered around a bit for the answer to this and can't for the life of my figure it out.
I've got a list of ~2,000-3,000 words in the following format:
Fact
Fiction
Funny
Funny
Funny
Funky
etc etc. I am looking to make numbers delete all the duplicate rows such that the above list would become:
Fact
Fiction
Funny
Funky
All of these words are in column A on a separate sheet in a numbers document I'm using to run an experiment. Is there a built in command or something that would do this? (I'm a COMPLETE beginner at using Numbers as a heads up)
Any help with this would be GREATLY appreciated.
Teaghue wrote:
Never mind! I found an old old post explaining that this can't be done in numbers, so I just did it in excel.
Perfectly wrong !
The way to achieve the described goal was described several times in this forum.
*_You just didn't search carefully !_*
Searching for delet AND duplicate return several threads.
Here are two of them.
I didn't made a typo. I used delet so that it retrieve delete as well as deleting
http://discussions.apple.com/thread.jspa?messageID=12992492
http://discussions.apple.com/thread.jspa?messageID=11559125
Yvan KOENIG (VALLAURIS, France) mercredi 2 mars 2011 17:59:40
Similar Messages
-
How to delete particular row in ALV list display
Hi All,
My requirement is :
I am displaying ouput using lav list dispplay befor the first colomn i am displaying check box. i defined my own pf status here . in pf status i have 3 buttons .
1 select all
2 deselect all
3 delete.
First two options are working fine when i click select all it is selecting all the rown in a program(selectiong all the check boxex) like working fine for deselecting all.
3 optioin Delete when i click delete option it has to delete partcular row in a list display and at the same time this entry should delete from the table. this is my requirement. for the third point(delete) option i dont have any logic. anybody can suggest me or send me the sameple code. i am sending my code below.if possible please modify the code and resend it to me.
type-pools : slis.
tables : zuser_secobjects.
data : t_header1 like zuser_secobjects.
data : begin of it_secobjects occurs 0.
include structure t_header1.
*data : box,
input(1) type c,
data : checkbox type c,
flag type c,
end of it_secobjects.
data : wa_ita like line of it_secobjects.
*data : it_secobjects like zuser_secobjects occurs 0 with header line.
data : i_field type slis_t_fieldcat_alv with header line.
data : w_field like line of i_field.
data : i_sort type slis_t_sortinfo_alv.
data : w_sort like line of i_sort.
data : it_filt1 type slis_t_filter_alv with header line.
data:
i_tabname type tabname,
i_repid like sy-repid,
is_lout type slis_layout_alv.
data : it_filt type slis_t_filter_alv with header line,
it_evts type slis_t_event with header line.
DATA : is_vari type disvariant.
constants : c_default_vari value 'X',
c_save_vari value 'U',
c_checkfield type slis_fieldname value 'ACTION',
c_f2code type sy-ucomm value '&ETA'.
data : chk_box type slis_fieldname.
selection-screen: begin of block b1 with frame title text-t01.
parameters : p_appln type zuser_secobjects-appln.
parameters : p_user type usr02-bname, "zuser_secobjects-appln_user,
p_partnr type zuser_secobjects-appln_partner,
p_ptype type zuser_secobjects-partner_type default '02',
p_upostn type zuser_secobjects-user_position,
p_sdate like likp-erdat default sy-datum,
p_edate(10) default '12/31/9999',
p_revnum type zuser_secobjects-revnum,
p_cted type zuser_secobjects-created_by,
p_cdate type zuser_secobjects-creation_date,
p_ctime type zuser_secobjects-creation_time,
p_chnby type zuser_secobjects-changed_by,
p_cdate1 type zuser_secobjects-changed_date,
p_ctime1 type zuser_secobjects-changed_time.
selection-screen: end of block b1.
form user_command using p_ucomm like sy-ucomm
rs_selfield type slis_selfield.
*DATA : it_filt type slis_t_filter_alv with header line.
case p_ucomm.
when 'SELECT_ALL'. " SELALL is the FCODE of ur push button
loop at it_secobjects into wa_ita.
wa_ita-checkbox = 'X'.
modify it_secobjects from wa_ita.
endloop.
rs_selfield-refresh = 'X'. "<- ADD THIS
when 'DESLCT_ALL'.
loop at it_secobjects into wa_ita.
wa_ita-checkbox = ' '.
modify it_secobjects from wa_ita.
endloop.
rs_selfield-refresh = 'X'. "<- ADD THIS
is_lout-f2code = c_f2code.
is_lout-box_fieldname = c_checkfield.
is_lout-get_selinfos = 'X'.
is_lout-detail_popup = 'X'.
is_lout-detail_initial_lines = 'X'.
when 'HIDE_DEL'.
rs_selfield-exit = 'X'.
it_filt-fieldname = 'ACTION'.
it_filt-tabname = '1'.
it_filt-valuf = 'X'.
it_filt-intlen = '1'.
it_filt-inttype = 'C'.
it_filt-datatype = 'CHAR'.
it_filt-valuf_int = 'X'.
it_filt-sign0 = 'E'.
it_filt-optio = 'EQ'.
if it_filt[] is initial.
append it_filt.
else.
modify it_filt index 1.
endif.
perform display using i_object.
PERForm ALV_LIST_DISPLAY.
WHEN 'SHOW_DEL'.
rs_selfield-exit = 'X'.
free it_filt.
PERForm ALV_LIST_DISPLAY.
when 'SAVE1'.
select * from zuser_secobjects where
appln = zuser_secobjects-appln
and appln_partner = zuser_secobjects-appln_partner
and partner_type = zuser_secobjects-partner_type
and start_date = zuser_secobjects-start_date
and end_date = zuser_secobjects-end_date.
endselect.
if sy-subrc eq 0.
message e000(ZV) with 'Duplicate Entry'.
endif.
endcase.
endform.
*& Form delete
form delete.
data : begin of is_secobjects occurs 0.
include structure zuser_secobjects.
data : checkbox type c.
data : end of is_secobjects.
is_secobjects-checkbox = 'X'.
modify is_secobjects
from it_secobjects
transporting checkbox
where checkbox = 'X'.
endform.
*& Form get_data
form get_data.
select * from zuser_secobjects
into table it_secobjects.
endform. " get_data
*& Form prepare_fieldcatalog
text
--> p1 text
<-- p2 text
form prepare_fieldcatalog.
clear: w_field,i_field.
refresh:i_field.
i_field-key = 'X'.
i_field-col_pos = 1.
i_field-ddictxt = 'S'.
i_field-seltext_s = '@11@'.
i_field-checkbox = 'X'.
i_field-input = 'X'.
i_field-fieldname = 'HEADER'.
i_field-outputlen = 0.
append i_field.
clear i_field.
w_field-fieldname = 'APPLN'.
w_field-tabname = 'IT_SECOBJECTS'.
w_field-seltext_l = text-m01.
w_field-outputlen = '10'.
w_field-col_pos = 1.
append w_field to i_field.
clear w_field.
w_field-fieldname = 'APPLN_USER'.
w_field-tabname = 'IT_SECOBJECTS'.
w_field-just = 'C'.
w_field-seltext_l = text-m02.
w_field-outputlen = '7'.
w_field-col_pos = 2.
append w_field to i_field.
clear w_field.
endform. " prepare_fieldcatalog
*& Form ALV_LIST_DISPLAY
text
--> p1 text
<-- p2 text
form alv_list_display.
i_repid = sy-repid.
is_lout-box_fieldname = 'CHECKBOX'.
it_filt-fieldname = 'ACTION'.
call function 'REUSE_ALV_LIST_DISPLAY'
exporting
i_callback_program = i_repid
i_callback_pf_status_set = 'PF_STATUS_SET'
i_callback_user_command = 'USER_COMMAND'
is_layout = is_lout
it_fieldcat = i_field[]
it_filter = it_filt[]
it_events = it_evts[]
i_default = c_default_vari
i_save = c_save_vari
is_variant = is_vari
tables
t_outtab = it_secobjects.
endform. " ALV_LIST_DISPLAY
*& Form display
text
-->P_I_OBJECT text
form display using object.
case object.
ENDCASE.
endform. " display
thanks,
maheedhar.tHI
In my program checkbox(before the record is displayed)
I used following lines to display checkbox .
i_field-key = 'X'.
i_field-col_pos = 1.
i_field-ddictxt = 'S'.
i_field-seltext_s = '@11@'.
i_field-checkbox = 'X'. <- Using this command i am getting checkbox
i_field-input = 'X'.
when i select this checkbox i press delete option then this entry will remove from internal table and refresh the screen and at the same time i will click on save button this ztable has to update according to that action.
this is my requirement.
thanks,
maheedhar. -
How to delete duplicate row in certain case
Hi all,</p>
<p>I need you help to delete my duplicate row.</p>
<p>Sample Data in table (<b>table1</b>)</p>
<p style="margin-top: 0; margin-bottom: 0"> </p>
<p style="margin-top: 0; margin-bottom: 0"><b>Timein
DateIn
locationin useridin
status</b></p>
<p style="margin-top: 0; margin-bottom: 0">08:20:00 01/09/2007
0001
U01
1</p>
<p style="margin-top: 0; margin-bottom: 0">08:10:30 01/09/2007
0004
U01
1</p>
<p style="margin-top: 0; margin-bottom: 0">07:20:00 01/09/2007
0006
U01
1</p>
<p style="margin-top: 0; margin-bottom: 0">08:14:00 01/09/2007
0001
U02
1</p>
<p style="margin-top: 0; margin-bottom: 0">06:10:30 01/09/2007
0004
U02
1</p>
<p style="margin-top: 0; margin-bottom: 0">08:10:10 01/09/2007
0006
U02
1</p>
<p> </p>
<p>I need to delete the row in table1 and leave the minimum <b>timein</b> in
that table by <b>useridin</b>.</p>
<p>The last output in table1 is like below.</p>
<p style="margin-top: 0; margin-bottom: 0"><b>Timein
DateIn
locationin useridin
status</b></p>
<p style="margin-top: 0; margin-bottom: 0">07:20:00 01/09/2007
0006
U01
1</p>
<p style="margin-top: 0; margin-bottom: 0">06:10:30 01/09/2007
0004
U02
1</p>
<p>Can i used below sql to output the result;</p>
<font FACE="Courier" SIZE="2">
<p style="margin-top: 0; margin-bottom: 0"></font>
<font FACE="Courier" SIZE="2" COLOR="#0000ff">delete</font><font FACE="Courier" SIZE="2">
</font><font FACE="Courier" SIZE="2" COLOR="#0000ff">from</font><font FACE="Courier" SIZE="2">
<font color="#808000">table1</font> t1 </font>
<font FACE="Courier" SIZE="2" COLOR="#0000ff">where</font><font FACE="Courier" SIZE="2">
t1</font><font FACE="Courier" SIZE="2" COLOR="#0000ff">.</font><font FACE="Courier" SIZE="2" COLOR="#ff0000">rowid</font><font FACE="Courier" SIZE="2">
</font><font FACE="Courier" SIZE="2" COLOR="#0000ff">></p>
</font><font FACE="Courier" SIZE="2">
<p style="margin-top: 0; margin-bottom: 0"></font>
<font FACE="Courier" SIZE="2" COLOR="#0000ff">(</font><font FACE="Courier" SIZE="2">
</font><font FACE="Courier" SIZE="2" COLOR="#0000ff">select</font><font FACE="Courier" SIZE="2">
</font><font FACE="Courier" SIZE="2" COLOR="#0000ff">min(</font><font FACE="Courier" SIZE="2">t2</font><font FACE="Courier" SIZE="2" COLOR="#0000ff">.</font><font FACE="Courier" SIZE="2" COLOR="#ff0000">rowID</font><font FACE="Courier" SIZE="2" COLOR="#0000ff">)</font><font FACE="Courier" SIZE="2">
</font><font FACE="Courier" SIZE="2" COLOR="#0000ff">from</font><font FACE="Courier" SIZE="2">
<font color="#808000">table1</font> t2</p>
<p style="margin-top: 0; margin-bottom: 0"></font>
<font FACE="Courier" SIZE="2" COLOR="#0000ff">where</font><font FACE="Courier" SIZE="2">
t1</font><font FACE="Courier" SIZE="2" COLOR="#0000ff">.</font><font face="Courier" size="2">Datein
= t2.Datein</font></p>
<font FACE="Courier" SIZE="2">
<p style="margin-top: 0; margin-bottom: 0"></font>
<font FACE="Courier" SIZE="2" COLOR="#0000ff">and</font><font FACE="Courier" SIZE="2">
t1</font><font FACE="Courier" SIZE="2" COLOR="#0000ff">.</font><font FACE="Courier" SIZE="2">Status
</font><font FACE="Courier" SIZE="2" COLOR="#0000ff">=</font><font FACE="Courier" SIZE="2">
t2</font><font FACE="Courier" SIZE="2" COLOR="#0000ff">.</font><font FACE="Courier" SIZE="2">Status</font></p>
<p style="margin-top: 0; margin-bottom: 0">
<font FACE="Courier" SIZE="2" COLOR="#0000ff">and</font><font FACE="Courier" SIZE="2">
t1</font><font FACE="Courier" SIZE="2" COLOR="#0000ff">.</font>UserIdin
<font FACE="Courier" SIZE="2" COLOR="#0000ff">=</font><font FACE="Courier" SIZE="2">
t2</font><font FACE="Courier" SIZE="2" COLOR="#0000ff">.</font>UserIdin
<font FACE="Courier" SIZE="2" COLOR="#0000ff">order by t2.timein);</font></p>
<p style="margin-top: 0; margin-bottom: 0"> </p>
<p style="margin-top: 0; margin-bottom: 0"><font face="Courier" size="2">Thanks
in advancedHi Rob,
Just trying to chip in little bit!
Created Table As follows same as you, only two rows with duplicatem user, datein, and timein:
create table table1
as
select '08:20:00' timein, date '2007-09-01' datein, '0001' locationin, 'U01' useridin, 1 status from dual union all
select '08:10:30', date '2007-09-01', '0004', 'U01', 1 from dual union all
select '07:20:00', date '2007-09-01', '0006', 'U01', 1 from dual union all
select '08:14:00', date '2007-09-01', '0001', 'U02', 1 from dual union all
select '06:10:30', date '2007-09-01', '0004', 'U02', 1 from dual union all
select '06:10:30', date '2007-09-01', '0001', 'U02', 1 from dual
If I run your delete statement result row will be as follows:
SQL> select * from table1;
TIMEIN DATEIN LOCA USE STATUS
07:20:00 01-SEP-07 0006 U01 1
06:10:30 01-SEP-07 0004 U02 1
06:10:30 01-SEP-07 0001 U02 1
Here problem is that its not able to delete duplicate rows having same timein and timeout.
So I changed you query as follows:
DELETE FROM tab1
WHERE rowid NOT IN (
SELECT MIN(rowid)
FROM tab1
WHERE (UseridIn, TO_DATE(TO_CHAR(DateIn,'YYYYMMDD') || TimeIn,'YYYYMMDDHH24:MI:SS')) IN
( SELECT UseridIn, MIN(TO_DATE(TO_CHAR(DateIn,'YYYYMMDD') || timein,'YYYYMMDDHH24:MI:SS'))
FROM tab1
GROUP BY UseridIn)
GROUP BY UseridIn
If I run your delete statement with little bit of changes, the result row was as follows:
SQL> select * from table1;
TIMEIN DATEIN LOCA USE STATUS
07:20:00 01-SEP-07 0006 U01 1
06:10:30 01-SEP-07 0004 U02 1
Regards,
Raj -
How to delete duplicate rows in oracle and retaining last duplicate rows
Hi,
I'm having millions of records in the table .Some duplicate values/rows are inserted in it.
I just want to delete duplicate rows but also want to retain the last duplicate row.
For eg if one record is found three times ,i want to delete first and second record and retain
the third one i.e the last inserted one.
Regards
Paramdeep Singhuser13310594 wrote:
Hi,
I'm having millions of records in the table .Some duplicate values/rows are inserted in it.
I just want to delete duplicate rows but also want to retain the last duplicate row.
For eg if one record is found three times ,i want to delete first and second record and retain
the third one i.e the last inserted one.Hi Paramdeep,
To start with, since you do not wish to keep multiple rows with same values, why allow them to get inserted in the first place?
Wouldn't it be easier to block duplicate rows from inserting by creating a Unique constraint on Column(s) that define a row as duplicate, then rather deleting duplicate rows periodically?
For deleting duplicate rows, there are N number of techniques available. Always remember, you need to have a rigid criteria that marks row as duplicate.
[url http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:15258974323143]this is one recomended by tom for large tables.
Vivek L -
Deleting duplicate rows based on three columns in Oracle 8i
Hi all,
The database we use is Oracle 8i.
The query below raises the too_many_rows exception when I launch an application. So I want to delete the duplicated rows :
select polarisation_1, polarisation_2
into v_pol1_tech, v_pol2_tech
from v_cfh_lien_element
where nom_lien = p_nom_lien
AND num_canal_1 = p_num_canal_1
AND freq_emise_1 = p_freq_emise_1;
Notice that with many possible values of the parameters p_nom_lien, p_num_canal_1 and p_freq_emise_1 then the exception is raised.
So how to delete generally the duplicated rows based on the three columns "nom_lien" , "num_canal_1" and "freq_emise_1" ?
Thank you very much indeed.Check the other thread with same question deleting duplicate rows based on three columns in Oracle 8i
-
Change array size and delete duplicate row
Hello,
I am running a program that does a for loop 3 times. In each loop, data is collected for x and y points (10 in the example provided). How can I output the array with the 30 points in a simple 2D array (size 2x30)?
Also, from the array, how do I delete duplicate rows that contain the same x-value?
Thanks,
hiNi.
Solved!
Go to Solution.
Attachments:
array size.vi 10 KBHello,
THANK YOU for solving my first issue! Attached is the data set that contains the duplicate entries for the x-axis values. The y-axis value may be different, but not the x. I would like to delete the 2nd row that contains the same x-value.
Here is simple example of my input and desired output:
IN:
28.512000 -115.310532
28.812000 -86.937660
29.112000 -116.877052
29.412000 -87.223625
29.412000 -111.349045
30.012000 -86.510780
30.312000 -112.048187
OUT:
28.512000 -115.310532
28.812000 -86.937660
29.112000 -116.877052
29.412000 -87.223625
30.012000 -86.510780
30.312000 -112.048187
I am thinking of comparig the last x-axis value to the current one, and if it is the same, then not parse that row. The attached VI is as far as I got.
Any help will be greatly appreciated.
Thanks,
hiNi
Attachments:
delete duplicate row.vi 8 KB
data.txt 1 KB -
Delete duplicate rows -- based on 4 columns -- how?
I asked this question on how to delete duplicates recently and received this suggestion which works well -- except --
With CTE AS
SELECT *, ROW_NUMBER() OVER (Partition by fld1 order by fld1) RowNum
FROM #tmpA
DELETE From CTE
WHERE RowNum > 1
-- the actual table I need to delete duplicate rows on is based on 4 columns. The following table contains 14,462 rows of which 14,348 are distinct -- based on the following 4 colums. Below is an image of a sample of the data contained in the
table for my question and to the right of that data is the column structures (data types). Is it possible to do something like the above example suggestion with the table in the image below? How to do that? I need to delete rows so that 14462
goes down to 14348. If I only reference one column for the delete -- this would delete like 7000+ rows. I only need to remove 114 rows.
Rich PAdd the other 3 columns to the partition.
Jason Long -
How to Delete duplicates rows without using rowid/distinct.
How to delete duplicates rows present in a table without using rowid or even distinct.
How about:
SQL> SELECT * FROM t1;
A B
1 2
2 3
1 2
4 4
4 4
4 4
SQL> DELETE FROM t1
2 WHERE (a, b) IN (SELECT a, b FROM t1
3 GROUP BY a, b
4 HAVING COUNT(*) > 1) and
5 rownum = 1;
1 row deleted.
SQL> /
1 row deleted.
SQL> /
1 row deleted.
SQL> /
0 rows deleted.
SQL> SELECT * FROM t1;
A B
2 3
1 2
4 4Although, if I was asked a similar question with all those restrictions, my first response would be along the lines of: Is this question indicative of the way I will have to work if I join this company? If so, there is no point answering because I wouldn't touch this job with a ten foot pole. -
SQL Server 2014 - Delete duplicate rows in a table except one
Hi all,
I have a table that contains duplicate rows. Using grouping I can easily identify those rows.
As of now, I count the grouped records and copy one of the group in a temporary table together with its count of elements. Than I loop over this table and delete N - 1 rows of each group from the original table. Unfortunately this is done with two cursors
and WHILE loops.
Is anybody out there who could give some hints how to handle deletion of duplicated rows leaving one in place using pure SQL? I tried a full delete of all elements of a group and then an INSERT of one row to recreate a row again. But this is not
very elegant and close to using cursors.
Regards UweHi all,
based on input below from Uri, I have developed a little more general solution for removal of duplicates. I did that, because I'm sure that for many beginners in SQL it is easier specialize a proposal by removing parts of it than adding new functionality.
Here is my code.
-- Remove duplicates from a table and document the deleted rows
DECLARE @MyTable Table (Col1 int, Col2 int, Col3 int, Col4 int);
DECLARE @OutTable Table (Col1 int, Col2 int, Col3 int, Col4 int);
INSERT INTO @MyTable VALUES
(1, 10, 100, 7),
(2, 20, 200, 2),
(2, 20, 200, 1),
(3, 30, 300, 3),
(1, 10, 200, 4),
(1, 10, 100, 5),
(1, 10, 100, 6);
WITH cte (RN, Col1, Col2, Col3, Col4)
AS (SELECT ROW_NUMBER() OVER (PARTITION BY Col1, Col2, Col3 ORDER BY (SELECT 0)) AS RN, Col1, Col2, Col3, Col4
FROM @MyTable)
DELETE FROM cte
OUTPUT DELETED.Col1, DELETED.Col2, DELETED.Col3, DELETED.Col4
INTO @OutTable (Col1, Col2, Col3, Col4)
WHERE RN > 1;
SELECT * FROM @OutTable;
And this is the result:
The MS 139444 article Satish mentioned is focussed on duplicate PKs removal. Thanks for the hint.
Thanks to you all for your rapid response.
Regards Uwe -
Duplicate rows displayed in list
I am using ADF, Struts and JSP.
On occasion, some of the pages that simply display a list of attibutes in a VO display duplicate rows - these views reference just one EO and in the majority of cases all of the default settings are used.
There seems to be no consistency as to what causes this, at first it would appear after a new row had been inserted but then is would just appear when listing the detilas.
If you refresh the list (event invokes executeQuery() to refresh the data from the DB) then the duplicate row goes away.
This happens on my development machine (using JDev 10.1.2) and on the Application Server deployment.
Has anyone esle seen this?
Does anyone know why this might be happening and what I can do to solve this problem?
Thanks
AlanMarcos - thanks for the reply - this is the type of answer I was looking for since I'm not able to find anywhere in my code that I'm inserting a new row.
However, I've tried this approach and am still experiencing the issue. I wanted to check that I had the right items checked / not checked. I don't have an item that says Disconnect Application Module 'unmanaged Release' - mine just says 'Release'. Here are my options (Jdev 10.1.3):
(default unchecked) Failover Transaction State Upon Managed Release
(default unchecked) Disconnect Application Module Upon Release
(default checked) Support Dynamic JDBC Credentials
(default checked) Reset Non-Transcational State Upon Unmanaged Release
(default checked) Enable Application Module Pooing
I've tried multiple combinations of checking / un-checking options (including having everything checked except the 2nd item above) and still get the same issue. I'm going to read up in the developer guide to see if I can understand these better.
By the way, can you let me know which passivate state options you have set for your View Object that was showing the duplicate row but is now working? For example, right-click on VO, select edit - what items are checked on the Tuning tab?
#1 Fill Last Page of Rows when Paging through Rowset
#2 Passivate State
#2a Including all Transient Values
#3 Retain View Link Accessor
Thanks -
Delete Duplicate rows in Data Package based on selection
Hello experts,
I have the data coming from Oracle using DB_Connect. The data has duplicate order no. I need to delete the duplicate rows in the data package based selection before updating the data target.
I am thinking of writing this in updaterule start routine. I would greatly appreciate any sample code on selective deletion of data package rows.
Thanks a lot!
SriNagesh,
Thanks for your reply.
Do I need write this in Update Start routine?
Another thing the order number field is coming from source system. Currently we are not mapping/assingning to InfoObject. In other words we are not seding order no to data target.
In my query can I write something like this...
DELETE ADJACENT DUPLICATES FROM DATA_PACKAGE COMPARING DATA_Package-OrderNo
Thanks a lot!
Sri -
How to delete duplicate rows in a table
hai,
i have a table which consists of hunderds of records and contains duplicate records also. how can i delete duplicate records.
thanks
raviThis maybe a litle bit fast for deletion:-
delete from emp where rowid in (
2 SELECT rowid FROM emp
3 group by rowid,empno,ename,job
4 minus
5 SELECT min(rowid) FROM emp
6 group by empno,ename,job); -
Generalise Delete Duplicate Rows Query work in any Database
Hello Friends,
I need generalize SQL Query for removal of duplicate data from a table.
Condition: It will work in both the database Oracle as well as SQL Server 2005.
Waiting for your valuable response on the above issue.
Thanks/Regards,
Bhavin Patel
Please reply to this post...Thanks, Nimish for your reply..._
I know how to delete duplicate values entry from Oracle database.
I'm using below method quite often when to delete duplicate value from the Oracle database.::
SELECT * FROM dept do
WHERE do.ROWID NOT IN (SELECT MIN(di.ROWID) FROM dept di WHERE di.deptno = do.deptno)
WITH T1 AS
(SELECT dept.*,ROW_NUMBER() OVER(PARTITION BY deptno,dname ORDER BY deptno) RNUM FROM dept)
SELECT * FROM T1 WHERE RNUM > 1
Actually in interview this question asked to me, I've given Oracle process, but unable to give solution for SQL Server or DB2 -
i have a wage table where wage id is sequence generated column
here is the sample data ..like this i have so many records but if i know how to delete for 1 record i can do for the rest.
wage id account_no period wage
712345 1111 20033 3000
712360 1111 20033 3000
712361 1111 20034 3000
712324 1111 20041 4000
The second row is a duplicate data because for 2003 3rd quarter there is a duplicate record ... how do u delete it.
Thank you for your help in advance ...
Edited by: Data Boy on Dec 30, 2009 10:43 AMSQL> select * from your_table;
WAGE_ID ACCOUNT_NO PERIOD WAGE
712345 1111 20033 3000
712360 1111 20033 3000
712361 1111 20034 3000
712324 1111 20041 4000
SQL> delete from your_table a
2 where exists ( select null
3 from ( select wage_id
4 , row_number() over (partition by account_no, period order by wage_id ) rn
5 from your_table
6 ) b
7 where b.rn>1
8 and a.wage_id = b.wage_id
9 );
1 row deleted.
SQL> select * from your_table;
WAGE_ID ACCOUNT_NO PERIOD WAGE
712345 1111 20033 3000
712361 1111 20034 3000
712324 1111 20041 4000 -
Delete multiple rows from table/list control
Hi,
I want to have a table control in which a user can enter different entries, like this:
My program would read each entry at a time and do something.
However, I would like to give the user ability to delete multiple entries at once, like in an Excel spreadsheet - that is, the user selects multiple rows and presses "Delete" key and those entries get deleted. The Labview table does not allow this it seems - I can only delete one entry at a time - or I have to right-click and select Data Operations->Cut Data, which is awkward.
Is there a control better suited to what I want to do? I tried a Llist control, but it behaves in the same manner.
Thanks in advance!
Solved!
Go to Solution.You could write your own routine. Use an Event Structure with a Key Down event. If the delete key was pressed and the table has focus delete the elements that are selected.
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
Maybe you are looking for
-
Hi I have a cube which holds the records. I am loading from this cube to DSO. Cube has example fields: Record 1 is f1=10, f2=20, f3=30, f4=50 and key figure k1= 0.5 Record 2 is f1=10, f2=20, f3=30, f4=50 and key figure k1= 0.5 All f1 to f5 are in key
-
Deploying WebService to Tomcat
Hello, I make a simple "HelloWorld" webservice by making a java class with a "hello" method and using the "Create J2EE WebService". Upon deplying to Tomcat, I the application won't start in Tomcat and the logs show the following error which I don't u
-
Using the included business catalyst space
With full Adobe Create Cloud membership I get 5 websites from Business Catalyst included. Cool! But what if I am not interested in the Adobe CMS tools, and want to install say a Wordpress of Drupal webiste in this Business Catalyst space (this 20GB o
-
Odd file name ("[") found in /bin
While nosing around, I found this file produced by ls /usr: -r-xr-xr-x 2 root wheel 42656 Jan 13 2006 [ Any advice on how to proceed? Thanks, Mark T. MacBook White (1st, gen, base configuration) Mac OS X (10.4.7) May '05 Switcher, never looked ba
-
GarageBand turns my guitar down
GB11 noob here. This is my first project and I've run into a problem. Recording a guitar track direct from my POD HD500 (guitar -> pedal board -> irig -> computer's headphone port). Initial attack sounds awesome! But after about 5 seconds of playing,