SQL Query Help need on Train data

ADX 156 Reputation points
2021-10-25T06:41:41.54+00:00

NA-----------

Azure Data Explorer
Azure Data Explorer
An Azure data analytics service for real-time analysis on large volumes of data streaming from sources including applications, websites, and internet of things devices.
480 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Olaf Helper 40,741 Reputation points
    2021-10-25T08:04:51.047+00:00

    Please copy and paste into the notepad for better view.

    Don't make it better, still not really readable.
    Please post table design as DDL, some sample data as DML statement and the expected result.


  2. MelissaMa-MSFT 24,176 Reputation points
    2021-10-25T09:00:34.003+00:00

    Hi @ADX ,

    Welcome to Microsoft Q&A!

    For this type of problem we recommend that you post CREATE TABLE statements for your tables together with INSERT statements with sample data since your sample data is not readable enough.

    According to your requirement, it is a little difficult to achieve in TSQL.

    You could use UNPIVOT if you would like to convert one row of multiple columns to multiple rows in one table.

    But there are many duplicated column names in your sample data which is not permitted in the table definition.

    You may consider to deal with it in excel or other tool.

    Best regards,
    Melissa


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment". 
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.