MySQL - Faster way to duplicate values without groupingHow do you set a default value for a MySQL Datetime column?Which MySQL data type to use for storing boolean valuesMySQL Query GROUP BY day / month / yearFinding duplicate values in MySQLFind duplicate records in MySQLRetrieving the last record in each group - MySQLDuplicating a MySQL table, indices, and dataPHP Mysql group by date from accumulative valuesMySQL get all characters before specific charactercount of distincts substring in query
Does C++20 mandate source code being stored in files?
Is a butterfly one or two animals?
Does a logistic regression maximizing likelihood necessarily also maximize AUC over linear models?
TechSupport Issue ID#812
Are there any legal requirements concerning airline pilots and their watches?
Using は before 欲しい instead が
"Silverware", "Tableware", and "Dishes"
Do living authors still get paid royalties for their old work?
How can I pack my food so it doesn't smell?
Earliest evidence of objects intended for future archaeologists?
Cheap storage lockers in Tromsø, Norway
!I!n!s!e!r!t! !n!b!e!t!w!e!e!n!
Metal that glows when near pieces of itself
Why don't politicians push for fossil fuel reduction by pointing out their scarcity?
How can I describe being temporarily stupid?
Interaction between Ethereal Absolution versus Edgar Markov with Captivating Vampire
Why does AC run even when it is cooler outside than in?
Why do some academic journals requires a separate "summary" paragraph in addition to an abstract?
Can I submit a paper under an alias so as to avoid trouble in my country?
Use of vor in this sentence
Story that includes a description: "Two concentric circles, intersecting at three points"
How could Tony Stark wield the Infinity Nano Gauntlet - at all?
Unbiased estimator of exponential of measure of a set?
Why didn’t Doctor Strange stay in the original winning timeline?
MySQL - Faster way to duplicate values without grouping
How do you set a default value for a MySQL Datetime column?Which MySQL data type to use for storing boolean valuesMySQL Query GROUP BY day / month / yearFinding duplicate values in MySQLFind duplicate records in MySQLRetrieving the last record in each group - MySQLDuplicating a MySQL table, indices, and dataPHP Mysql group by date from accumulative valuesMySQL get all characters before specific charactercount of distincts substring in query
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
i'm using a code to return duplicated values in my table, without grouping. Showing something like this:
Value1 3
Value1 3
Value1 3
Value2 4
Value2 4
Value2 4
Value2 4
Value3 1
This code above is what i'm using. But, they are taking around 35s to be done, there is a way optimize or improve this code to be faster ? My table there 400,000+ values
SELECT A.* FROM authors A JOIN(SELECT *, COUNT(identification) AS quantity FROM authors GROUP BY identification) AS B WHERE A.identification = B.identification AND (A.identification AND B.identification) <> '' ((SUBSTRING(A.identification, -4) AND SUBSTRING(B.identification, -4) > 2017) AND B.quantity = 2) OR B.quantity > 2 ORDER BY B.quantity ASC
mysql join count inner-join
add a comment |
i'm using a code to return duplicated values in my table, without grouping. Showing something like this:
Value1 3
Value1 3
Value1 3
Value2 4
Value2 4
Value2 4
Value2 4
Value3 1
This code above is what i'm using. But, they are taking around 35s to be done, there is a way optimize or improve this code to be faster ? My table there 400,000+ values
SELECT A.* FROM authors A JOIN(SELECT *, COUNT(identification) AS quantity FROM authors GROUP BY identification) AS B WHERE A.identification = B.identification AND (A.identification AND B.identification) <> '' ((SUBSTRING(A.identification, -4) AND SUBSTRING(B.identification, -4) > 2017) AND B.quantity = 2) OR B.quantity > 2 ORDER BY B.quantity ASC
mysql join count inner-join
add a comment |
i'm using a code to return duplicated values in my table, without grouping. Showing something like this:
Value1 3
Value1 3
Value1 3
Value2 4
Value2 4
Value2 4
Value2 4
Value3 1
This code above is what i'm using. But, they are taking around 35s to be done, there is a way optimize or improve this code to be faster ? My table there 400,000+ values
SELECT A.* FROM authors A JOIN(SELECT *, COUNT(identification) AS quantity FROM authors GROUP BY identification) AS B WHERE A.identification = B.identification AND (A.identification AND B.identification) <> '' ((SUBSTRING(A.identification, -4) AND SUBSTRING(B.identification, -4) > 2017) AND B.quantity = 2) OR B.quantity > 2 ORDER BY B.quantity ASC
mysql join count inner-join
i'm using a code to return duplicated values in my table, without grouping. Showing something like this:
Value1 3
Value1 3
Value1 3
Value2 4
Value2 4
Value2 4
Value2 4
Value3 1
This code above is what i'm using. But, they are taking around 35s to be done, there is a way optimize or improve this code to be faster ? My table there 400,000+ values
SELECT A.* FROM authors A JOIN(SELECT *, COUNT(identification) AS quantity FROM authors GROUP BY identification) AS B WHERE A.identification = B.identification AND (A.identification AND B.identification) <> '' ((SUBSTRING(A.identification, -4) AND SUBSTRING(B.identification, -4) > 2017) AND B.quantity = 2) OR B.quantity > 2 ORDER BY B.quantity ASC
mysql join count inner-join
mysql join count inner-join
edited Mar 27 at 14:49
L.Th
asked Mar 27 at 14:40
L.ThL.Th
286 bronze badges
286 bronze badges
add a comment |
add a comment |
0
active
oldest
votes
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%2f55379935%2fmysql-faster-way-to-duplicate-values-without-grouping%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
Is this question similar to what you get asked at work? Learn more about asking and sharing private information with your coworkers using Stack Overflow for Teams.
Is this question similar to what you get asked at work? Learn more about asking and sharing private information with your coworkers using 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%2f55379935%2fmysql-faster-way-to-duplicate-values-without-grouping%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