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 4617020
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T02:03:55+00:00 2026-05-22T02:03:55+00:00

On Google I just found group by sum (integer value). How can I group

  • 0

On Google I just found group by sum (integer value). How can I group by a string value? For the table:

No   Place    Car 
---  ------   --------
1    NY       VRM1
1    BT       VLI
2    NY       GAR
3    GT       GAR

How can I group by ‘No’? I tried:

SELECT No, place, Car 
FROM  APPEL
GROUP BY No, Place, Car

But it didn’t work.

I want to have a table like this

No   Place    Car 
---  ------   --------
1    NY,BT    VRM1,VLI
2    NY       GAR
3    GT       GAR
  • 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-05-22T02:03:56+00:00Added an answer on May 22, 2026 at 2:03 am
    -- Sample data
    with T (No,   Place,    Car) as
    (
    select 1,    'NY',       'VRM1' union all
    select 1,    'BT',       'VLI' union all
    select 2,    'NY',       'GAR' union all
    select 3,    'GT',       'GAR'
    )
    
    -- The query
    select
      T.No,
      stuff((select ','+T2.Place
             from T as T2 
             where T.No = T2.No
             for xml path(''), type).value('.', 'nvarchar(max)'), 1, 1, '') as Place,
      stuff((select ','+T2.Car
             from T as T2 
             where T.No = T2.No
             for xml path(''), type).value('.', 'nvarchar(max)'), 1, 1, '') as Car
    from T
    group by T.No
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

A quick Google search of this issue shows it's common, I just can't for
(I just posted this in the NUnit discussion group on groups.google.com) Under VS 2008,
Even though I found Hadley's post in the google group on POSIXct and geom_vline
I need to utilize the Google Maps API. I just found out a minute
Okay. I know this looks like the typical Why didn't he just Google it
Have just started using Google Chrome , and noticed in parts of our site,
I just finished watching the Google clean code video on YouTube (see link ,
I just came across this code and a few Google searches turn up no
I was just looking through some information about Google's protocol buffers data interchange format.
Google's not coming to my rescue, here, and I just know this is the

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.