converting range to rows?2019 Community Moderator ElectionMySQL pivot row into dynamic number of columnsMysql query to dynamically convert rows to columnsConvert a row as column and merge two column as its valueIssue in Convert row into columnConvert Rows to column rows in SQL ServerMySQL converting columns to rowsMySQL Query - Use Self Join To Find Rows Closest To Start and End DatesConvert row to 4 columns in sql serverHow to pivot a dataframeMySQL - Convert multiple rows with matching data on a unique row with multiple columns

Do I need life insurance if I can cover my own funeral costs?

How to deal with taxi scam when on vacation?

Time travel from stationary position?

How to write cleanly even if my character uses expletive language?

My adviser wants to be the first author

Are ETF trackers fundamentally better than individual stocks?

PTIJ: Who should I vote for? (21st Knesset Edition)

How to make healing in an exploration game interesting

Unexpected result from ArcLength

Charles Hockett - 'F' article?

how to write formula in word in latex

How can I track script which gives me "command not found" right after the login?

Min function accepting varying number of arguments in C++17

Gravity magic - How does it work?

Why did it take so long to abandon sail after steamships were demonstrated?

Is a party consisting of only a bard, a cleric, and a warlock functional long-term?

Why one should not leave fingerprints on bulbs and plugs?

Audio processing. Is it possible to directly access the decoded audio data going into the analog input of a computer

Existence of subset with given Hausdorff dimension

The difference between「N分で」and「後N分で」

A sequence that has integer values for prime indexes only:

How to terminate ping <dest> &

Are there other languages, besides English, where the indefinite (or definite) article varies based on sound?

Professor being mistaken for a grad student



converting range to rows?



2019 Community Moderator ElectionMySQL pivot row into dynamic number of columnsMysql query to dynamically convert rows to columnsConvert a row as column and merge two column as its valueIssue in Convert row into columnConvert Rows to column rows in SQL ServerMySQL converting columns to rowsMySQL Query - Use Self Join To Find Rows Closest To Start and End DatesConvert row to 4 columns in sql serverHow to pivot a dataframeMySQL - Convert multiple rows with matching data on a unique row with multiple columns










0















I have a data like below.



+----+---------+----------+---------+
| id | start | end | data_id |
+----+---------+----------+---------+
| 1 | 0 | 16777215 | 1 |
| 2 |16777216 | 16777471 | 2 |
| 3 |16777472 | 16778239 | 3 |
| 4 |16778240 | 16779263 | 4 |


As you see I have start, end column and FK to other table.



Now I want to convert it to like below.



+-----------+---------+
| number | data_id |
+-----------+---------+
| 0 | 1 |
| 1 | 1 |
| 2 | 1 |
...
| 16777215 | 1 |
| 16777216 | 2 |


...



Want to number range to individual numbered row.



Is there any way to do it?










share|improve this question




























    0















    I have a data like below.



    +----+---------+----------+---------+
    | id | start | end | data_id |
    +----+---------+----------+---------+
    | 1 | 0 | 16777215 | 1 |
    | 2 |16777216 | 16777471 | 2 |
    | 3 |16777472 | 16778239 | 3 |
    | 4 |16778240 | 16779263 | 4 |


    As you see I have start, end column and FK to other table.



    Now I want to convert it to like below.



    +-----------+---------+
    | number | data_id |
    +-----------+---------+
    | 0 | 1 |
    | 1 | 1 |
    | 2 | 1 |
    ...
    | 16777215 | 1 |
    | 16777216 | 2 |


    ...



    Want to number range to individual numbered row.



    Is there any way to do it?










    share|improve this question


























      0












      0








      0








      I have a data like below.



      +----+---------+----------+---------+
      | id | start | end | data_id |
      +----+---------+----------+---------+
      | 1 | 0 | 16777215 | 1 |
      | 2 |16777216 | 16777471 | 2 |
      | 3 |16777472 | 16778239 | 3 |
      | 4 |16778240 | 16779263 | 4 |


      As you see I have start, end column and FK to other table.



      Now I want to convert it to like below.



      +-----------+---------+
      | number | data_id |
      +-----------+---------+
      | 0 | 1 |
      | 1 | 1 |
      | 2 | 1 |
      ...
      | 16777215 | 1 |
      | 16777216 | 2 |


      ...



      Want to number range to individual numbered row.



      Is there any way to do it?










      share|improve this question
















      I have a data like below.



      +----+---------+----------+---------+
      | id | start | end | data_id |
      +----+---------+----------+---------+
      | 1 | 0 | 16777215 | 1 |
      | 2 |16777216 | 16777471 | 2 |
      | 3 |16777472 | 16778239 | 3 |
      | 4 |16778240 | 16779263 | 4 |


      As you see I have start, end column and FK to other table.



      Now I want to convert it to like below.



      +-----------+---------+
      | number | data_id |
      +-----------+---------+
      | 0 | 1 |
      | 1 | 1 |
      | 2 | 1 |
      ...
      | 16777215 | 1 |
      | 16777216 | 2 |


      ...



      Want to number range to individual numbered row.



      Is there any way to do it?







      pivot mariadb






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Mar 6 at 20:02









      Dave

      2,73381730




      2,73381730










      asked Mar 6 at 19:47









      user670097user670097

      59118




      59118






















          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%2f55031105%2fconverting-range-to-rows%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















          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%2f55031105%2fconverting-range-to-rows%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

          AWS Lex not identifying response if by a variable The 2019 Stack Overflow Developer Survey Results Are In Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern) The Ask Question Wizard is Live! Data science time! April 2019 and salary with experienceEnforcing custom enumeration in AWS LEX for slot valuesHow to give response based on user response in Amazon Lex?Intercepting AWS Lambda Response to a AWS Lex QueryLex chat bot error: Reached second execution of fulfillment lambda on the same utteranceamazon lex showing invalid responseLambda response send back to Lex slot?Response card in Amazon lexAmazon Lex - Lambda response return HTML to botHow can I solve 424 (Failed Dependency) (python) obtained from Amazon lex?

          Алба-Юлія

          Захаров Федір Захарович