How can I optimise this SQL query to delete every second duplicate row?How can I prevent SQL injection in PHP?How to concatenate text from multiple rows into a single text string in SQL server?Inserting multiple rows in a single SQL query?How do I limit the number of rows returned by an Oracle query after ordering?How can I do an UPDATE statement with JOIN in SQL?SQL Server: How to Join to first rowDelete all Duplicate Rows except for One in MySQL?How can I delete one of two perfectly identical rows?How to Delete using INNER JOIN with SQL Server?How to delete duplicate rows in SQL Server?
How did C64 games handle music during gameplay?
How can I tell if there was a power cut while I was out?
Can I pay with HKD in Macau or Shenzhen?
How do I run a game when my PCs have different approaches to combat?
How to repeat the last : command for a visual selection instead of whole buffer?
Determine if a triangle is equilateral, isosceles, or scalene
Extrapolation v. Interpolation
High income, sudden windfall
Sitecore Powershell extensions module compatibility with Sitecore 9.2
What would be the side effects on the life of a person becoming indestructible?
Why did NASA use Imperial units?
USA: Can a witness take the 5th to avoid perjury?
Is Grandpa Irrational? Another Grandpa Mystery
Why are off grid solar setups only 12, 24, 48 VDC?
What is a reasonable time for modern human society to adapt to dungeons?
Film where a boy turns into a princess
How may I shorten this shell script?
What is "ass door"?
Should I describe a character deeply before killing it?
Grid/table with lots of buttons
Historicity doubted by Romans
Why are line integrals not always path independent?
Where is this photo of a group of hikers taken? Is it really in the Ural?
how to add 1 milliseconds on a datetime string?
How can I optimise this SQL query to delete every second duplicate row?
How can I prevent SQL injection in PHP?How to concatenate text from multiple rows into a single text string in SQL server?Inserting multiple rows in a single SQL query?How do I limit the number of rows returned by an Oracle query after ordering?How can I do an UPDATE statement with JOIN in SQL?SQL Server: How to Join to first rowDelete all Duplicate Rows except for One in MySQL?How can I delete one of two perfectly identical rows?How to Delete using INNER JOIN with SQL Server?How to delete duplicate rows in SQL Server?
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
I need to keep only one row where a value is duplicated, i.e. delete every row that is not the "first" one with the duplicate value.
I have the following table called ART_NEW:
PHARMACODE | GTIN | Other stuff
111 1234 ...
- PHARMACODE is the primary key (integer)
- GTIN is another integer, suposedly unique, but collisions sometimes happen.
The data source for this table is preparing to transition from PHARMACODE to GTIN as the primary key, but this transition is not yet complete. I am not in control of the source in any way.
To use GTIN as a PK in some application, I need to delete all but one of the rows where GTIN is duplicated (all rows with the same GTIN describe the same product, with slight variations in its description, so it doesn't matter which row is deleted and which one is not, as long as I end up with only one row for a specific GTIN value).
The following query does exactly what I need, but is horrendously slow (> 1 minute execution time on 350'000 records with 120 rows with duplicate GTIN values):
DELETE *
FROM ART_NEW
WHERE ART_NEW.PHARMACODE IN
(SELECT PHARMACODE FROM
(SELECT
ART_NEW.[PHARMACODE],
ART_NEW.GTIN,
(SELECT Count(*)
FROM ART_NEW As X
WHERE X.GTIN = ART_NEW.GTIN
AND X.PHARMACODE <= ART_NEW.PHARMACODE) AS SeqNo
FROM ART_NEW
WHERE ART_NEW.[GTIN] In
(SELECT [GTIN] FROM [ART_NEW] As Tmp GROUP BY [GTIN] HAVING Count(*)>1))
WHERE SeqNo > 1);
How can I optimise this code? Alternatively, is there a better way to achieve my goal of deleting every row but one with duplicate GTIN values?
sql ms-access
add a comment |
I need to keep only one row where a value is duplicated, i.e. delete every row that is not the "first" one with the duplicate value.
I have the following table called ART_NEW:
PHARMACODE | GTIN | Other stuff
111 1234 ...
- PHARMACODE is the primary key (integer)
- GTIN is another integer, suposedly unique, but collisions sometimes happen.
The data source for this table is preparing to transition from PHARMACODE to GTIN as the primary key, but this transition is not yet complete. I am not in control of the source in any way.
To use GTIN as a PK in some application, I need to delete all but one of the rows where GTIN is duplicated (all rows with the same GTIN describe the same product, with slight variations in its description, so it doesn't matter which row is deleted and which one is not, as long as I end up with only one row for a specific GTIN value).
The following query does exactly what I need, but is horrendously slow (> 1 minute execution time on 350'000 records with 120 rows with duplicate GTIN values):
DELETE *
FROM ART_NEW
WHERE ART_NEW.PHARMACODE IN
(SELECT PHARMACODE FROM
(SELECT
ART_NEW.[PHARMACODE],
ART_NEW.GTIN,
(SELECT Count(*)
FROM ART_NEW As X
WHERE X.GTIN = ART_NEW.GTIN
AND X.PHARMACODE <= ART_NEW.PHARMACODE) AS SeqNo
FROM ART_NEW
WHERE ART_NEW.[GTIN] In
(SELECT [GTIN] FROM [ART_NEW] As Tmp GROUP BY [GTIN] HAVING Count(*)>1))
WHERE SeqNo > 1);
How can I optimise this code? Alternatively, is there a better way to achieve my goal of deleting every row but one with duplicate GTIN values?
sql ms-access
In VBA using DAO, loop through the sorted recordset and, for each record, store and check GTIN against the stored GTIN from the previous record. If a rule is met, delete the record and move on.
– Gustav
Mar 26 at 15:31
add a comment |
I need to keep only one row where a value is duplicated, i.e. delete every row that is not the "first" one with the duplicate value.
I have the following table called ART_NEW:
PHARMACODE | GTIN | Other stuff
111 1234 ...
- PHARMACODE is the primary key (integer)
- GTIN is another integer, suposedly unique, but collisions sometimes happen.
The data source for this table is preparing to transition from PHARMACODE to GTIN as the primary key, but this transition is not yet complete. I am not in control of the source in any way.
To use GTIN as a PK in some application, I need to delete all but one of the rows where GTIN is duplicated (all rows with the same GTIN describe the same product, with slight variations in its description, so it doesn't matter which row is deleted and which one is not, as long as I end up with only one row for a specific GTIN value).
The following query does exactly what I need, but is horrendously slow (> 1 minute execution time on 350'000 records with 120 rows with duplicate GTIN values):
DELETE *
FROM ART_NEW
WHERE ART_NEW.PHARMACODE IN
(SELECT PHARMACODE FROM
(SELECT
ART_NEW.[PHARMACODE],
ART_NEW.GTIN,
(SELECT Count(*)
FROM ART_NEW As X
WHERE X.GTIN = ART_NEW.GTIN
AND X.PHARMACODE <= ART_NEW.PHARMACODE) AS SeqNo
FROM ART_NEW
WHERE ART_NEW.[GTIN] In
(SELECT [GTIN] FROM [ART_NEW] As Tmp GROUP BY [GTIN] HAVING Count(*)>1))
WHERE SeqNo > 1);
How can I optimise this code? Alternatively, is there a better way to achieve my goal of deleting every row but one with duplicate GTIN values?
sql ms-access
I need to keep only one row where a value is duplicated, i.e. delete every row that is not the "first" one with the duplicate value.
I have the following table called ART_NEW:
PHARMACODE | GTIN | Other stuff
111 1234 ...
- PHARMACODE is the primary key (integer)
- GTIN is another integer, suposedly unique, but collisions sometimes happen.
The data source for this table is preparing to transition from PHARMACODE to GTIN as the primary key, but this transition is not yet complete. I am not in control of the source in any way.
To use GTIN as a PK in some application, I need to delete all but one of the rows where GTIN is duplicated (all rows with the same GTIN describe the same product, with slight variations in its description, so it doesn't matter which row is deleted and which one is not, as long as I end up with only one row for a specific GTIN value).
The following query does exactly what I need, but is horrendously slow (> 1 minute execution time on 350'000 records with 120 rows with duplicate GTIN values):
DELETE *
FROM ART_NEW
WHERE ART_NEW.PHARMACODE IN
(SELECT PHARMACODE FROM
(SELECT
ART_NEW.[PHARMACODE],
ART_NEW.GTIN,
(SELECT Count(*)
FROM ART_NEW As X
WHERE X.GTIN = ART_NEW.GTIN
AND X.PHARMACODE <= ART_NEW.PHARMACODE) AS SeqNo
FROM ART_NEW
WHERE ART_NEW.[GTIN] In
(SELECT [GTIN] FROM [ART_NEW] As Tmp GROUP BY [GTIN] HAVING Count(*)>1))
WHERE SeqNo > 1);
How can I optimise this code? Alternatively, is there a better way to achieve my goal of deleting every row but one with duplicate GTIN values?
sql ms-access
sql ms-access
asked Mar 26 at 15:22
Damien CateauDamien Cateau
178 bronze badges
178 bronze badges
In VBA using DAO, loop through the sorted recordset and, for each record, store and check GTIN against the stored GTIN from the previous record. If a rule is met, delete the record and move on.
– Gustav
Mar 26 at 15:31
add a comment |
In VBA using DAO, loop through the sorted recordset and, for each record, store and check GTIN against the stored GTIN from the previous record. If a rule is met, delete the record and move on.
– Gustav
Mar 26 at 15:31
In VBA using DAO, loop through the sorted recordset and, for each record, store and check GTIN against the stored GTIN from the previous record. If a rule is met, delete the record and move on.
– Gustav
Mar 26 at 15:31
In VBA using DAO, loop through the sorted recordset and, for each record, store and check GTIN against the stored GTIN from the previous record. If a rule is met, delete the record and move on.
– Gustav
Mar 26 at 15:31
add a comment |
2 Answers
2
active
oldest
votes
looks like PHARMACODE is numeric, that should work with standard SQL:
delete * from ART_NEW
where ART_NEW.PHARMACODE NOT IN
(select a3.PHARMACODE from (select min(a2.PHARMACODE) as PHARMACODE, a2.GTIN from ART_NEW a2 group by a2.GTIN) a3)
;
select * from ART_NEW
where ART_NEW.PHARMACODE IN
(select a3.PHARMACODE from (select min(a2.PHARMACODE) as PHARMACODE, a2.GTIN from ART_NEW a2 group by a2.GTIN) a3)
;
Also, if you are able to use Partitions, try making Where for row=1 with OVER (PARTITION BY GTIN).
Your current code was multiplying the tables, making it effectively run over 350,000*350,000 records...
– Oly
Mar 26 at 15:51
Thanks for this explanation, it is indeed multiplying the tables!
– Damien Cateau
Mar 27 at 6:56
1
With a slight adaptation, your query worked: used as is, it would select/delete one row per GTIN, even if it was not a duplicate. By runing two sequential queries (the first one to detect the duplicates, the second one to delete the rows withmin(PHARMACODE)), the process was greatly sped up. Thanks for pointing me in the right direction!
– Damien Cateau
Mar 27 at 7:20
Yes, sorry, created the first query just to detect duplicates to be deleted, but didn't elaborate! Happy it helped
– Oly
Apr 4 at 19:06
add a comment |
If you don't have a primary key on the table this is an easy way to delete duplicate rows. Set your PartitionBy to be what you would consider would be your uniqueidentifier and your order by to be your sort order making your most top row your valid data and everything that sorts below it be your invalid data to be deleted.
DELETE a
FROM (
SELECT
ROW_NUMBER() OVER (PARTITION BY tableUniqueid ORDER BY dateCreated DESC) AS SEQ,
*
FROM myTable
) a
WHERE SEQ > 1
Sadly, desktop Access does not have a built-inROW_NUMBER, and thePartitionfunction is absolutely unlike the SQLPARTITIONstatement.
– Damien Cateau
Mar 27 at 7:23
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55360713%2fhow-can-i-optimise-this-sql-query-to-delete-every-second-duplicate-row%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
looks like PHARMACODE is numeric, that should work with standard SQL:
delete * from ART_NEW
where ART_NEW.PHARMACODE NOT IN
(select a3.PHARMACODE from (select min(a2.PHARMACODE) as PHARMACODE, a2.GTIN from ART_NEW a2 group by a2.GTIN) a3)
;
select * from ART_NEW
where ART_NEW.PHARMACODE IN
(select a3.PHARMACODE from (select min(a2.PHARMACODE) as PHARMACODE, a2.GTIN from ART_NEW a2 group by a2.GTIN) a3)
;
Also, if you are able to use Partitions, try making Where for row=1 with OVER (PARTITION BY GTIN).
Your current code was multiplying the tables, making it effectively run over 350,000*350,000 records...
– Oly
Mar 26 at 15:51
Thanks for this explanation, it is indeed multiplying the tables!
– Damien Cateau
Mar 27 at 6:56
1
With a slight adaptation, your query worked: used as is, it would select/delete one row per GTIN, even if it was not a duplicate. By runing two sequential queries (the first one to detect the duplicates, the second one to delete the rows withmin(PHARMACODE)), the process was greatly sped up. Thanks for pointing me in the right direction!
– Damien Cateau
Mar 27 at 7:20
Yes, sorry, created the first query just to detect duplicates to be deleted, but didn't elaborate! Happy it helped
– Oly
Apr 4 at 19:06
add a comment |
looks like PHARMACODE is numeric, that should work with standard SQL:
delete * from ART_NEW
where ART_NEW.PHARMACODE NOT IN
(select a3.PHARMACODE from (select min(a2.PHARMACODE) as PHARMACODE, a2.GTIN from ART_NEW a2 group by a2.GTIN) a3)
;
select * from ART_NEW
where ART_NEW.PHARMACODE IN
(select a3.PHARMACODE from (select min(a2.PHARMACODE) as PHARMACODE, a2.GTIN from ART_NEW a2 group by a2.GTIN) a3)
;
Also, if you are able to use Partitions, try making Where for row=1 with OVER (PARTITION BY GTIN).
Your current code was multiplying the tables, making it effectively run over 350,000*350,000 records...
– Oly
Mar 26 at 15:51
Thanks for this explanation, it is indeed multiplying the tables!
– Damien Cateau
Mar 27 at 6:56
1
With a slight adaptation, your query worked: used as is, it would select/delete one row per GTIN, even if it was not a duplicate. By runing two sequential queries (the first one to detect the duplicates, the second one to delete the rows withmin(PHARMACODE)), the process was greatly sped up. Thanks for pointing me in the right direction!
– Damien Cateau
Mar 27 at 7:20
Yes, sorry, created the first query just to detect duplicates to be deleted, but didn't elaborate! Happy it helped
– Oly
Apr 4 at 19:06
add a comment |
looks like PHARMACODE is numeric, that should work with standard SQL:
delete * from ART_NEW
where ART_NEW.PHARMACODE NOT IN
(select a3.PHARMACODE from (select min(a2.PHARMACODE) as PHARMACODE, a2.GTIN from ART_NEW a2 group by a2.GTIN) a3)
;
select * from ART_NEW
where ART_NEW.PHARMACODE IN
(select a3.PHARMACODE from (select min(a2.PHARMACODE) as PHARMACODE, a2.GTIN from ART_NEW a2 group by a2.GTIN) a3)
;
Also, if you are able to use Partitions, try making Where for row=1 with OVER (PARTITION BY GTIN).
looks like PHARMACODE is numeric, that should work with standard SQL:
delete * from ART_NEW
where ART_NEW.PHARMACODE NOT IN
(select a3.PHARMACODE from (select min(a2.PHARMACODE) as PHARMACODE, a2.GTIN from ART_NEW a2 group by a2.GTIN) a3)
;
select * from ART_NEW
where ART_NEW.PHARMACODE IN
(select a3.PHARMACODE from (select min(a2.PHARMACODE) as PHARMACODE, a2.GTIN from ART_NEW a2 group by a2.GTIN) a3)
;
Also, if you are able to use Partitions, try making Where for row=1 with OVER (PARTITION BY GTIN).
answered Mar 26 at 15:48
OlyOly
1577 bronze badges
1577 bronze badges
Your current code was multiplying the tables, making it effectively run over 350,000*350,000 records...
– Oly
Mar 26 at 15:51
Thanks for this explanation, it is indeed multiplying the tables!
– Damien Cateau
Mar 27 at 6:56
1
With a slight adaptation, your query worked: used as is, it would select/delete one row per GTIN, even if it was not a duplicate. By runing two sequential queries (the first one to detect the duplicates, the second one to delete the rows withmin(PHARMACODE)), the process was greatly sped up. Thanks for pointing me in the right direction!
– Damien Cateau
Mar 27 at 7:20
Yes, sorry, created the first query just to detect duplicates to be deleted, but didn't elaborate! Happy it helped
– Oly
Apr 4 at 19:06
add a comment |
Your current code was multiplying the tables, making it effectively run over 350,000*350,000 records...
– Oly
Mar 26 at 15:51
Thanks for this explanation, it is indeed multiplying the tables!
– Damien Cateau
Mar 27 at 6:56
1
With a slight adaptation, your query worked: used as is, it would select/delete one row per GTIN, even if it was not a duplicate. By runing two sequential queries (the first one to detect the duplicates, the second one to delete the rows withmin(PHARMACODE)), the process was greatly sped up. Thanks for pointing me in the right direction!
– Damien Cateau
Mar 27 at 7:20
Yes, sorry, created the first query just to detect duplicates to be deleted, but didn't elaborate! Happy it helped
– Oly
Apr 4 at 19:06
Your current code was multiplying the tables, making it effectively run over 350,000*350,000 records...
– Oly
Mar 26 at 15:51
Your current code was multiplying the tables, making it effectively run over 350,000*350,000 records...
– Oly
Mar 26 at 15:51
Thanks for this explanation, it is indeed multiplying the tables!
– Damien Cateau
Mar 27 at 6:56
Thanks for this explanation, it is indeed multiplying the tables!
– Damien Cateau
Mar 27 at 6:56
1
1
With a slight adaptation, your query worked: used as is, it would select/delete one row per GTIN, even if it was not a duplicate. By runing two sequential queries (the first one to detect the duplicates, the second one to delete the rows with
min(PHARMACODE) ), the process was greatly sped up. Thanks for pointing me in the right direction!– Damien Cateau
Mar 27 at 7:20
With a slight adaptation, your query worked: used as is, it would select/delete one row per GTIN, even if it was not a duplicate. By runing two sequential queries (the first one to detect the duplicates, the second one to delete the rows with
min(PHARMACODE) ), the process was greatly sped up. Thanks for pointing me in the right direction!– Damien Cateau
Mar 27 at 7:20
Yes, sorry, created the first query just to detect duplicates to be deleted, but didn't elaborate! Happy it helped
– Oly
Apr 4 at 19:06
Yes, sorry, created the first query just to detect duplicates to be deleted, but didn't elaborate! Happy it helped
– Oly
Apr 4 at 19:06
add a comment |
If you don't have a primary key on the table this is an easy way to delete duplicate rows. Set your PartitionBy to be what you would consider would be your uniqueidentifier and your order by to be your sort order making your most top row your valid data and everything that sorts below it be your invalid data to be deleted.
DELETE a
FROM (
SELECT
ROW_NUMBER() OVER (PARTITION BY tableUniqueid ORDER BY dateCreated DESC) AS SEQ,
*
FROM myTable
) a
WHERE SEQ > 1
Sadly, desktop Access does not have a built-inROW_NUMBER, and thePartitionfunction is absolutely unlike the SQLPARTITIONstatement.
– Damien Cateau
Mar 27 at 7:23
add a comment |
If you don't have a primary key on the table this is an easy way to delete duplicate rows. Set your PartitionBy to be what you would consider would be your uniqueidentifier and your order by to be your sort order making your most top row your valid data and everything that sorts below it be your invalid data to be deleted.
DELETE a
FROM (
SELECT
ROW_NUMBER() OVER (PARTITION BY tableUniqueid ORDER BY dateCreated DESC) AS SEQ,
*
FROM myTable
) a
WHERE SEQ > 1
Sadly, desktop Access does not have a built-inROW_NUMBER, and thePartitionfunction is absolutely unlike the SQLPARTITIONstatement.
– Damien Cateau
Mar 27 at 7:23
add a comment |
If you don't have a primary key on the table this is an easy way to delete duplicate rows. Set your PartitionBy to be what you would consider would be your uniqueidentifier and your order by to be your sort order making your most top row your valid data and everything that sorts below it be your invalid data to be deleted.
DELETE a
FROM (
SELECT
ROW_NUMBER() OVER (PARTITION BY tableUniqueid ORDER BY dateCreated DESC) AS SEQ,
*
FROM myTable
) a
WHERE SEQ > 1
If you don't have a primary key on the table this is an easy way to delete duplicate rows. Set your PartitionBy to be what you would consider would be your uniqueidentifier and your order by to be your sort order making your most top row your valid data and everything that sorts below it be your invalid data to be deleted.
DELETE a
FROM (
SELECT
ROW_NUMBER() OVER (PARTITION BY tableUniqueid ORDER BY dateCreated DESC) AS SEQ,
*
FROM myTable
) a
WHERE SEQ > 1
answered Mar 26 at 16:48
JamesMurrayJamesMurray
614 bronze badges
614 bronze badges
Sadly, desktop Access does not have a built-inROW_NUMBER, and thePartitionfunction is absolutely unlike the SQLPARTITIONstatement.
– Damien Cateau
Mar 27 at 7:23
add a comment |
Sadly, desktop Access does not have a built-inROW_NUMBER, and thePartitionfunction is absolutely unlike the SQLPARTITIONstatement.
– Damien Cateau
Mar 27 at 7:23
Sadly, desktop Access does not have a built-in
ROW_NUMBER, and the Partition function is absolutely unlike the SQL PARTITION statement.– Damien Cateau
Mar 27 at 7:23
Sadly, desktop Access does not have a built-in
ROW_NUMBER, and the Partition function is absolutely unlike the SQL PARTITION statement.– Damien Cateau
Mar 27 at 7:23
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55360713%2fhow-can-i-optimise-this-sql-query-to-delete-every-second-duplicate-row%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
In VBA using DAO, loop through the sorted recordset and, for each record, store and check GTIN against the stored GTIN from the previous record. If a rule is met, delete the record and move on.
– Gustav
Mar 26 at 15:31