Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Database & SysAdmin
  3. Database
  4. MSSQL select values in one row by group

MSSQL select values in one row by group

Scheduled Pinned Locked Moved Database
asp-netsql-servergraphicsperformancetutorial
3 Posts 2 Posters 9 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    Sergey Makarov 2022
    wrote on last edited by
    #1

    Hey all, there is a MSSQL table with such data,

    categoryName specificationValue unitName

    Display 15.6 inch
    Display LED, HD, Anti-glare NULL
    Processor CORE I3 NULL
    Processor 1005G1 NULL
    Processor 1.2 UP TO 3.4 GHz
    Graphics Card INTEL NULL
    Graphics Card Intel UHD Graphics NULL
    System Memory 8 GB
    System Memory DDR4 NULL
    Hard Disk 256 PCIe® NVMe™ SSD GB
    Operating System Windows 10 Home NULL
    Operating System 64 bit
    Optical Drive DVD NULL
    Physical 1.78 kg

    I need to get the following line (is it even possible?)

    15.6inch LED, HD, Anti-glare | CORE I3 1005G1 1.2 UP TO 3.4 | INTEL Intel UHD Graphics | 8 GB DDR4 | Windows 10 Home 64bit | DVD | 1.78kg

    To be honest, I don't really understand how to do this need your support thanks!

    OriginalGriffO 1 Reply Last reply
    0
    • S Sergey Makarov 2022

      Hey all, there is a MSSQL table with such data,

      categoryName specificationValue unitName

      Display 15.6 inch
      Display LED, HD, Anti-glare NULL
      Processor CORE I3 NULL
      Processor 1005G1 NULL
      Processor 1.2 UP TO 3.4 GHz
      Graphics Card INTEL NULL
      Graphics Card Intel UHD Graphics NULL
      System Memory 8 GB
      System Memory DDR4 NULL
      Hard Disk 256 PCIe® NVMe™ SSD GB
      Operating System Windows 10 Home NULL
      Operating System 64 bit
      Optical Drive DVD NULL
      Physical 1.78 kg

      I need to get the following line (is it even possible?)

      15.6inch LED, HD, Anti-glare | CORE I3 1005G1 1.2 UP TO 3.4 | INTEL Intel UHD Graphics | 8 GB DDR4 | Windows 10 Home 64bit | DVD | 1.78kg

      To be honest, I don't really understand how to do this need your support thanks!

      OriginalGriffO Offline
      OriginalGriffO Offline
      OriginalGriff
      wrote on last edited by
      #2

      Depends on your version of SQL Server. If it's 2017 or later, it's relatively simple. If it's earlier, not so much. See here: The SQL Server Equivalent to GROUP_CONCAT()[^]

      "I have no idea what I did, but I'm taking full credit for it." - ThisOldTony "Common sense is so rare these days, it should be classified as a super power" - Random T-shirt AntiTwitter: @DalekDave is now a follower!

      "I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
      "Common sense is so rare these days, it should be classified as a super power" - Random T-shirt

      S 1 Reply Last reply
      0
      • OriginalGriffO OriginalGriff

        Depends on your version of SQL Server. If it's 2017 or later, it's relatively simple. If it's earlier, not so much. See here: The SQL Server Equivalent to GROUP_CONCAT()[^]

        "I have no idea what I did, but I'm taking full credit for it." - ThisOldTony "Common sense is so rare these days, it should be classified as a super power" - Random T-shirt AntiTwitter: @DalekDave is now a follower!

        S Offline
        S Offline
        Sergey Makarov 2022
        wrote on last edited by
        #3

        thanks for fast reply! version 12 ((

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups