Need to find and list duplicates between multiple CTEsHow do you remove duplicates from a list whilst preserving order?Find duplicate records in MySQLSQL Server: How to Join to first rowFinding duplicate values in a SQL tableSQL Problem - Duplicate Names, listing all fieldsHow to select only the first rows for each unique value of a columnRemoving duplicates in listsCTE query not returning duplicate rowsIGNORE “column was specified multiple times for” CTESQL CTE to Find Senior Managers in Hierarchy (2nd Level from the Top)
Did the British navy fail to take into account the ballistics correction due to Coriolis force during WW1 Falkland Islands battle?
Can a Rogue PC teach an NPC to perform Sneak Attack?
What are some interesting features that are common cross-linguistically but don't exist in English?
What to say to a student who has failed?
Asymmetric table
Compelling story with the world as a villain
Network helper class with retry logic on failure
Why did Khan ask Admiral James T. Kirk about Project Genesis?
Localization at a multiplicative set is a localization at a prime ideal if local
Why is 7 Bd3 in the Cambridge Springs QGD more often met with 7...Ne4 than 7...dxc4?
Is MOSFET active device?
Are the A380 engines interchangeable (given they are not all equipped with reverse)?
How do I, an introvert, communicate to my friend and only colleague, an extrovert, that I want to spend my scheduled breaks without them?
Showing that the limit of non-eigenvector goes to infinity
Numbers Decrease while Letters Increase
Most natural way to use the negative with つもり
How can I unambiguously ask for a new user's "Display Name"?
Why isn't "I've" a proper response?
Is "The life is beautiful" incorrect or just very non-idiomatic?
How many US airports have 4 or more parallel runways?
Would it be possible to have a GMO that produces chocolate?
Are there any elected officials in the U.S. who are not legislators, judges, or constitutional officers?
How do proponents of Sola Scriptura address the ministry of those Apostles who authored no parts of Scripture?
Which book is the Murderer's Gloves magic item from?
Need to find and list duplicates between multiple CTEs
How do you remove duplicates from a list whilst preserving order?Find duplicate records in MySQLSQL Server: How to Join to first rowFinding duplicate values in a SQL tableSQL Problem - Duplicate Names, listing all fieldsHow to select only the first rows for each unique value of a columnRemoving duplicates in listsCTE query not returning duplicate rowsIGNORE “column was specified multiple times for” CTESQL CTE to Find Senior Managers in Hierarchy (2nd Level from the Top)
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
I need to identify duplicates on a single table where users have entered the name incorrectly (e.g., instead of putting "John" in fname
and "Smith" in lname
, a record which already exists, they put "Smith" in fname
and "John" in lname
). I need to identify these duplicates and list the duplicates and their correct record counterpart.
I have set up two CTEs, one to pull just the columns I need and one to pull the same columns that have the bad info to remove. The primary query pulls all the columns and compares the complete table against the CTE table with the duplicates. I can't do a comparison between the two CTEs becaus it will error (more than one row returned by a subquery used as an expression). In its current form the query returns 9813408908970990872314 results (I gave up at exporting 650k). This is a PostgreSQL database, unknown version, but it's 9+ I believe. There are ~320k valid rows on the person table and 2499 from the wrong_order
CTE. The key field is person.number
but each will have a unique number, even the wrong entries (every row gets one but not all rows have one due to deleted records that conflict with data retention rules).
WITH
correct_order AS (
SELECT (p.lname||', '|| p.fname) AS "name",
p.number AS "num",
p.birthdate AS "dob"
FROM person p
WHERE p.lname IS NOT NULL
),
wrong_order AS (
SELECT (p.fname||', '|| p.lname) AS "name",
p.number AS "num",
p.birthdate AS "dob"
FROM person p
WHERE (p.lname||', '|| p.fname) IN (p.fname||', '|| p.lname)
)
SELECT
correct_order.name AS "Correct Name",
correct_order.num AS "Correct Num",
correct_order.birthdate AS "Correct DOB",
wrong_order.name AS "Wrong Name",
wrong_order.num AS "Wrong Num",
wrong_order.birthdate AS "Wrong DOB"
FROM
correct_order, wrong_order
WHERE
correct_order.name IN (SELECT wrong_order.name FROM wrong_order)
I expected to see name/number/dob from both CTEs where both sets of data match between the two. What I got instead was a duplication where every conceivable combination of those six values. I have tried using a join in the main query (correct_order JOIN wrong_order ON correct_order.name = wrong_order.name
) but you can't use =
on a string and using IN
throws "more than one row...". While it may be possible to do in powershell after the fact I'm not strong enough to lift that without some help.
sql postgresql duplicates common-table-expression
add a comment |
I need to identify duplicates on a single table where users have entered the name incorrectly (e.g., instead of putting "John" in fname
and "Smith" in lname
, a record which already exists, they put "Smith" in fname
and "John" in lname
). I need to identify these duplicates and list the duplicates and their correct record counterpart.
I have set up two CTEs, one to pull just the columns I need and one to pull the same columns that have the bad info to remove. The primary query pulls all the columns and compares the complete table against the CTE table with the duplicates. I can't do a comparison between the two CTEs becaus it will error (more than one row returned by a subquery used as an expression). In its current form the query returns 9813408908970990872314 results (I gave up at exporting 650k). This is a PostgreSQL database, unknown version, but it's 9+ I believe. There are ~320k valid rows on the person table and 2499 from the wrong_order
CTE. The key field is person.number
but each will have a unique number, even the wrong entries (every row gets one but not all rows have one due to deleted records that conflict with data retention rules).
WITH
correct_order AS (
SELECT (p.lname||', '|| p.fname) AS "name",
p.number AS "num",
p.birthdate AS "dob"
FROM person p
WHERE p.lname IS NOT NULL
),
wrong_order AS (
SELECT (p.fname||', '|| p.lname) AS "name",
p.number AS "num",
p.birthdate AS "dob"
FROM person p
WHERE (p.lname||', '|| p.fname) IN (p.fname||', '|| p.lname)
)
SELECT
correct_order.name AS "Correct Name",
correct_order.num AS "Correct Num",
correct_order.birthdate AS "Correct DOB",
wrong_order.name AS "Wrong Name",
wrong_order.num AS "Wrong Num",
wrong_order.birthdate AS "Wrong DOB"
FROM
correct_order, wrong_order
WHERE
correct_order.name IN (SELECT wrong_order.name FROM wrong_order)
I expected to see name/number/dob from both CTEs where both sets of data match between the two. What I got instead was a duplication where every conceivable combination of those six values. I have tried using a join in the main query (correct_order JOIN wrong_order ON correct_order.name = wrong_order.name
) but you can't use =
on a string and using IN
throws "more than one row...". While it may be possible to do in powershell after the fact I'm not strong enough to lift that without some help.
sql postgresql duplicates common-table-expression
add a comment |
I need to identify duplicates on a single table where users have entered the name incorrectly (e.g., instead of putting "John" in fname
and "Smith" in lname
, a record which already exists, they put "Smith" in fname
and "John" in lname
). I need to identify these duplicates and list the duplicates and their correct record counterpart.
I have set up two CTEs, one to pull just the columns I need and one to pull the same columns that have the bad info to remove. The primary query pulls all the columns and compares the complete table against the CTE table with the duplicates. I can't do a comparison between the two CTEs becaus it will error (more than one row returned by a subquery used as an expression). In its current form the query returns 9813408908970990872314 results (I gave up at exporting 650k). This is a PostgreSQL database, unknown version, but it's 9+ I believe. There are ~320k valid rows on the person table and 2499 from the wrong_order
CTE. The key field is person.number
but each will have a unique number, even the wrong entries (every row gets one but not all rows have one due to deleted records that conflict with data retention rules).
WITH
correct_order AS (
SELECT (p.lname||', '|| p.fname) AS "name",
p.number AS "num",
p.birthdate AS "dob"
FROM person p
WHERE p.lname IS NOT NULL
),
wrong_order AS (
SELECT (p.fname||', '|| p.lname) AS "name",
p.number AS "num",
p.birthdate AS "dob"
FROM person p
WHERE (p.lname||', '|| p.fname) IN (p.fname||', '|| p.lname)
)
SELECT
correct_order.name AS "Correct Name",
correct_order.num AS "Correct Num",
correct_order.birthdate AS "Correct DOB",
wrong_order.name AS "Wrong Name",
wrong_order.num AS "Wrong Num",
wrong_order.birthdate AS "Wrong DOB"
FROM
correct_order, wrong_order
WHERE
correct_order.name IN (SELECT wrong_order.name FROM wrong_order)
I expected to see name/number/dob from both CTEs where both sets of data match between the two. What I got instead was a duplication where every conceivable combination of those six values. I have tried using a join in the main query (correct_order JOIN wrong_order ON correct_order.name = wrong_order.name
) but you can't use =
on a string and using IN
throws "more than one row...". While it may be possible to do in powershell after the fact I'm not strong enough to lift that without some help.
sql postgresql duplicates common-table-expression
I need to identify duplicates on a single table where users have entered the name incorrectly (e.g., instead of putting "John" in fname
and "Smith" in lname
, a record which already exists, they put "Smith" in fname
and "John" in lname
). I need to identify these duplicates and list the duplicates and their correct record counterpart.
I have set up two CTEs, one to pull just the columns I need and one to pull the same columns that have the bad info to remove. The primary query pulls all the columns and compares the complete table against the CTE table with the duplicates. I can't do a comparison between the two CTEs becaus it will error (more than one row returned by a subquery used as an expression). In its current form the query returns 9813408908970990872314 results (I gave up at exporting 650k). This is a PostgreSQL database, unknown version, but it's 9+ I believe. There are ~320k valid rows on the person table and 2499 from the wrong_order
CTE. The key field is person.number
but each will have a unique number, even the wrong entries (every row gets one but not all rows have one due to deleted records that conflict with data retention rules).
WITH
correct_order AS (
SELECT (p.lname||', '|| p.fname) AS "name",
p.number AS "num",
p.birthdate AS "dob"
FROM person p
WHERE p.lname IS NOT NULL
),
wrong_order AS (
SELECT (p.fname||', '|| p.lname) AS "name",
p.number AS "num",
p.birthdate AS "dob"
FROM person p
WHERE (p.lname||', '|| p.fname) IN (p.fname||', '|| p.lname)
)
SELECT
correct_order.name AS "Correct Name",
correct_order.num AS "Correct Num",
correct_order.birthdate AS "Correct DOB",
wrong_order.name AS "Wrong Name",
wrong_order.num AS "Wrong Num",
wrong_order.birthdate AS "Wrong DOB"
FROM
correct_order, wrong_order
WHERE
correct_order.name IN (SELECT wrong_order.name FROM wrong_order)
I expected to see name/number/dob from both CTEs where both sets of data match between the two. What I got instead was a duplication where every conceivable combination of those six values. I have tried using a join in the main query (correct_order JOIN wrong_order ON correct_order.name = wrong_order.name
) but you can't use =
on a string and using IN
throws "more than one row...". While it may be possible to do in powershell after the fact I'm not strong enough to lift that without some help.
sql postgresql duplicates common-table-expression
sql postgresql duplicates common-table-expression
edited Mar 27 at 18:45
Laurenz Albe
62.9k11 gold badges44 silver badges66 bronze badges
62.9k11 gold badges44 silver badges66 bronze badges
asked Mar 27 at 18:18
GryyphynGryyphyn
11 bronze badge
11 bronze badge
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
You have an unintended cross join in there (the FROM correct_order, wrong_order
has no join condition). That explains the astronomical row count.
You need to query along these lines:
SELECTS /* columns you need */
FROM person AS correct
JOIN person AS wrong
ON (correct.fname, correct.lname) =
(wrong.lname, wrong.fname)
WHERE correct.lname IS NOT NULL;
I hope I understood your intention correctly.
There is no problem comparing strings with =
, that must be a misunderstanding.
The logic in that join doesn't make sense to me (not to say it doesn't make sense). If the CTE is already there for comparison why re-declare the relationship between the table and it's alias? Consequently that threw a whole different error:
– Gryyphyn
Mar 27 at 19:07
Sorry, got distracted by the phone. The logic in that join doesn't make sense to me (not to say it doesn't make sense). If the CTE is already there for comparison why re-declare the relationship between the table and it's alias? Consequently that threw a whole different error: "relation "person" does not exist" SELECT [...] FROM person AS correct_order JOIN person AS wrong_order ON (correct_order.name) = (wrong_order.name) WHERE correct_order.name IS NOT NULL Is that what you meant?
– Gryyphyn
Mar 27 at 19:17
Laurenz, thanks for your help. It's always a semicolon, or in this case a parenthesis. When I did the join originally I didn't put the criteria in parentheses. So now it's working... kinda. Down to 18 duplicates.
– Gryyphyn
Mar 27 at 20:22
I meant that you should use no CTE at all. In your query, the table is calledperson
.
– Laurenz Albe
Mar 28 at 6:55
I get what you're saying. I guess I needed time away from that problem to see the solution. Thanks again Laurenz.
– Gryyphyn
Apr 25 at 17:36
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%2f55384061%2fneed-to-find-and-list-duplicates-between-multiple-ctes%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
You have an unintended cross join in there (the FROM correct_order, wrong_order
has no join condition). That explains the astronomical row count.
You need to query along these lines:
SELECTS /* columns you need */
FROM person AS correct
JOIN person AS wrong
ON (correct.fname, correct.lname) =
(wrong.lname, wrong.fname)
WHERE correct.lname IS NOT NULL;
I hope I understood your intention correctly.
There is no problem comparing strings with =
, that must be a misunderstanding.
The logic in that join doesn't make sense to me (not to say it doesn't make sense). If the CTE is already there for comparison why re-declare the relationship between the table and it's alias? Consequently that threw a whole different error:
– Gryyphyn
Mar 27 at 19:07
Sorry, got distracted by the phone. The logic in that join doesn't make sense to me (not to say it doesn't make sense). If the CTE is already there for comparison why re-declare the relationship between the table and it's alias? Consequently that threw a whole different error: "relation "person" does not exist" SELECT [...] FROM person AS correct_order JOIN person AS wrong_order ON (correct_order.name) = (wrong_order.name) WHERE correct_order.name IS NOT NULL Is that what you meant?
– Gryyphyn
Mar 27 at 19:17
Laurenz, thanks for your help. It's always a semicolon, or in this case a parenthesis. When I did the join originally I didn't put the criteria in parentheses. So now it's working... kinda. Down to 18 duplicates.
– Gryyphyn
Mar 27 at 20:22
I meant that you should use no CTE at all. In your query, the table is calledperson
.
– Laurenz Albe
Mar 28 at 6:55
I get what you're saying. I guess I needed time away from that problem to see the solution. Thanks again Laurenz.
– Gryyphyn
Apr 25 at 17:36
add a comment |
You have an unintended cross join in there (the FROM correct_order, wrong_order
has no join condition). That explains the astronomical row count.
You need to query along these lines:
SELECTS /* columns you need */
FROM person AS correct
JOIN person AS wrong
ON (correct.fname, correct.lname) =
(wrong.lname, wrong.fname)
WHERE correct.lname IS NOT NULL;
I hope I understood your intention correctly.
There is no problem comparing strings with =
, that must be a misunderstanding.
The logic in that join doesn't make sense to me (not to say it doesn't make sense). If the CTE is already there for comparison why re-declare the relationship between the table and it's alias? Consequently that threw a whole different error:
– Gryyphyn
Mar 27 at 19:07
Sorry, got distracted by the phone. The logic in that join doesn't make sense to me (not to say it doesn't make sense). If the CTE is already there for comparison why re-declare the relationship between the table and it's alias? Consequently that threw a whole different error: "relation "person" does not exist" SELECT [...] FROM person AS correct_order JOIN person AS wrong_order ON (correct_order.name) = (wrong_order.name) WHERE correct_order.name IS NOT NULL Is that what you meant?
– Gryyphyn
Mar 27 at 19:17
Laurenz, thanks for your help. It's always a semicolon, or in this case a parenthesis. When I did the join originally I didn't put the criteria in parentheses. So now it's working... kinda. Down to 18 duplicates.
– Gryyphyn
Mar 27 at 20:22
I meant that you should use no CTE at all. In your query, the table is calledperson
.
– Laurenz Albe
Mar 28 at 6:55
I get what you're saying. I guess I needed time away from that problem to see the solution. Thanks again Laurenz.
– Gryyphyn
Apr 25 at 17:36
add a comment |
You have an unintended cross join in there (the FROM correct_order, wrong_order
has no join condition). That explains the astronomical row count.
You need to query along these lines:
SELECTS /* columns you need */
FROM person AS correct
JOIN person AS wrong
ON (correct.fname, correct.lname) =
(wrong.lname, wrong.fname)
WHERE correct.lname IS NOT NULL;
I hope I understood your intention correctly.
There is no problem comparing strings with =
, that must be a misunderstanding.
You have an unintended cross join in there (the FROM correct_order, wrong_order
has no join condition). That explains the astronomical row count.
You need to query along these lines:
SELECTS /* columns you need */
FROM person AS correct
JOIN person AS wrong
ON (correct.fname, correct.lname) =
(wrong.lname, wrong.fname)
WHERE correct.lname IS NOT NULL;
I hope I understood your intention correctly.
There is no problem comparing strings with =
, that must be a misunderstanding.
edited Mar 27 at 18:46
answered Mar 27 at 18:39
Laurenz AlbeLaurenz Albe
62.9k11 gold badges44 silver badges66 bronze badges
62.9k11 gold badges44 silver badges66 bronze badges
The logic in that join doesn't make sense to me (not to say it doesn't make sense). If the CTE is already there for comparison why re-declare the relationship between the table and it's alias? Consequently that threw a whole different error:
– Gryyphyn
Mar 27 at 19:07
Sorry, got distracted by the phone. The logic in that join doesn't make sense to me (not to say it doesn't make sense). If the CTE is already there for comparison why re-declare the relationship between the table and it's alias? Consequently that threw a whole different error: "relation "person" does not exist" SELECT [...] FROM person AS correct_order JOIN person AS wrong_order ON (correct_order.name) = (wrong_order.name) WHERE correct_order.name IS NOT NULL Is that what you meant?
– Gryyphyn
Mar 27 at 19:17
Laurenz, thanks for your help. It's always a semicolon, or in this case a parenthesis. When I did the join originally I didn't put the criteria in parentheses. So now it's working... kinda. Down to 18 duplicates.
– Gryyphyn
Mar 27 at 20:22
I meant that you should use no CTE at all. In your query, the table is calledperson
.
– Laurenz Albe
Mar 28 at 6:55
I get what you're saying. I guess I needed time away from that problem to see the solution. Thanks again Laurenz.
– Gryyphyn
Apr 25 at 17:36
add a comment |
The logic in that join doesn't make sense to me (not to say it doesn't make sense). If the CTE is already there for comparison why re-declare the relationship between the table and it's alias? Consequently that threw a whole different error:
– Gryyphyn
Mar 27 at 19:07
Sorry, got distracted by the phone. The logic in that join doesn't make sense to me (not to say it doesn't make sense). If the CTE is already there for comparison why re-declare the relationship between the table and it's alias? Consequently that threw a whole different error: "relation "person" does not exist" SELECT [...] FROM person AS correct_order JOIN person AS wrong_order ON (correct_order.name) = (wrong_order.name) WHERE correct_order.name IS NOT NULL Is that what you meant?
– Gryyphyn
Mar 27 at 19:17
Laurenz, thanks for your help. It's always a semicolon, or in this case a parenthesis. When I did the join originally I didn't put the criteria in parentheses. So now it's working... kinda. Down to 18 duplicates.
– Gryyphyn
Mar 27 at 20:22
I meant that you should use no CTE at all. In your query, the table is calledperson
.
– Laurenz Albe
Mar 28 at 6:55
I get what you're saying. I guess I needed time away from that problem to see the solution. Thanks again Laurenz.
– Gryyphyn
Apr 25 at 17:36
The logic in that join doesn't make sense to me (not to say it doesn't make sense). If the CTE is already there for comparison why re-declare the relationship between the table and it's alias? Consequently that threw a whole different error:
– Gryyphyn
Mar 27 at 19:07
The logic in that join doesn't make sense to me (not to say it doesn't make sense). If the CTE is already there for comparison why re-declare the relationship between the table and it's alias? Consequently that threw a whole different error:
– Gryyphyn
Mar 27 at 19:07
Sorry, got distracted by the phone. The logic in that join doesn't make sense to me (not to say it doesn't make sense). If the CTE is already there for comparison why re-declare the relationship between the table and it's alias? Consequently that threw a whole different error: "relation "person" does not exist" SELECT [...] FROM person AS correct_order JOIN person AS wrong_order ON (correct_order.name) = (wrong_order.name) WHERE correct_order.name IS NOT NULL Is that what you meant?
– Gryyphyn
Mar 27 at 19:17
Sorry, got distracted by the phone. The logic in that join doesn't make sense to me (not to say it doesn't make sense). If the CTE is already there for comparison why re-declare the relationship between the table and it's alias? Consequently that threw a whole different error: "relation "person" does not exist" SELECT [...] FROM person AS correct_order JOIN person AS wrong_order ON (correct_order.name) = (wrong_order.name) WHERE correct_order.name IS NOT NULL Is that what you meant?
– Gryyphyn
Mar 27 at 19:17
Laurenz, thanks for your help. It's always a semicolon, or in this case a parenthesis. When I did the join originally I didn't put the criteria in parentheses. So now it's working... kinda. Down to 18 duplicates.
– Gryyphyn
Mar 27 at 20:22
Laurenz, thanks for your help. It's always a semicolon, or in this case a parenthesis. When I did the join originally I didn't put the criteria in parentheses. So now it's working... kinda. Down to 18 duplicates.
– Gryyphyn
Mar 27 at 20:22
I meant that you should use no CTE at all. In your query, the table is called
person
.– Laurenz Albe
Mar 28 at 6:55
I meant that you should use no CTE at all. In your query, the table is called
person
.– Laurenz Albe
Mar 28 at 6:55
I get what you're saying. I guess I needed time away from that problem to see the solution. Thanks again Laurenz.
– Gryyphyn
Apr 25 at 17:36
I get what you're saying. I guess I needed time away from that problem to see the solution. Thanks again Laurenz.
– Gryyphyn
Apr 25 at 17:36
add a comment |
Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.
Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.
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%2f55384061%2fneed-to-find-and-list-duplicates-between-multiple-ctes%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