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;








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










share|improve this question
































    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










    share|improve this question




























      0












      0








      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










      share|improve this question
















      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






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Mar 27 at 14:49







      L.Th

















      asked Mar 27 at 14:40









      L.ThL.Th

      286 bronze badges




      286 bronze badges

























          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
          );



          );













          draft saved

          draft discarded


















          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.



















          draft saved

          draft discarded
















































          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.




          draft saved


          draft discarded














          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





















































          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







          Popular posts from this blog

          SQL error code 1064 with creating Laravel foreign keysForeign key constraints: When to use ON UPDATE and ON DELETEDropping column with foreign key Laravel error: General error: 1025 Error on renameLaravel SQL Can't create tableLaravel Migration foreign key errorLaravel php artisan migrate:refresh giving a syntax errorSQLSTATE[42S01]: Base table or view already exists or Base table or view already exists: 1050 Tableerror in migrating laravel file to xampp serverSyntax error or access violation: 1064:syntax to use near 'unsigned not null, modelName varchar(191) not null, title varchar(191) not nLaravel cannot create new table field in mysqlLaravel 5.7:Last migration creates table but is not registered in the migration table

          용인 삼성생명 블루밍스 목차 통계 역대 감독 선수단 응원단 경기장 같이 보기 외부 링크 둘러보기 메뉴samsungblueminx.comeh선수 명단용인 삼성생명 블루밍스용인 삼성생명 블루밍스ehsamsungblueminx.comeheheheh

          155 수학 과학 기타 둘러보기 메뉴eh추가해eh문서를 완성해