Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8693097
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T00:27:58+00:00 2026-06-13T00:27:58+00:00

I have a requirement to concatenate values in different rows of my query based

  • 0

I have a requirement to concatenate values in different rows of my query based on Item ID.

For instance, I have the following rows of data.

GroupID LABEL   VALUE   UNIT
    1   Name    Henry   
    1   Guest   Manny   Guest
    1   Room    12  
    1   Milk    10      Quart
    1   Eggs    3       dozen
    2   Name    Mark    Supervisor
    2   Water   13      Litre
    2   Milk    3       Gallons
    2   Soap    12      bars

And as output, I want to get the following

ItemID     VALUE 

1          Name: Henry; Guest:Manny Guest; Room:12; Milk:10 Quart; Eggs: 3 dozen;

2          Name: Mark supervisor; Water: 13 litre; Milk: 3 Gallons; Soap: 12 bars;

How do I accomplish this please?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T00:28:00+00:00Added an answer on June 13, 2026 at 12:28 am

    Please try:

    SELECT DISTINCT a.GroupID AS ItemID,(
    SELECT ISNULL(b.LABEL,'')+': '+ISNULL(b.VALUE,'')+' '+ISNULL(b.UNIT,'')+';' FROM TABLE b WHERE b.GroupID=a.GroupID
    FOR XML PATH('')) AS [VALUE]
    FROM TABLE a
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have requirement as following like showing ABPeoplePickerNavigationController in tabbar based application. I researched
I have a table with columns A,B,C.My requirement is to concatenate the values of
I have this requirement to concatenate data from DNR2 (Parent) Message Data into the
I have requirement where when a user enter new item in a list first
I have requirement where in i want to download the files from different machines
I have the following XML: <questions> <question text=This is a test question?> <answer value=Yes>
I have requirement to access the folder from a another machine based on the
I have a requirement to send data from native program written in C through
I have the following method for bulk insert of the data in tables. First
I have requirement of selecting s subset of data from a collection using a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.