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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T02:31:13+00:00 2026-05-26T02:31:13+00:00

I am very inexperienced with SQL. I have a table that looks like this:

  • 0

I am very inexperienced with SQL. I have a table that looks like this:

Columns:   A   B   C   D   E
           foo bar 1   2   3
           foo bar 4   5   6
           foo bar 7   8   9
           xyz abc 3   2   1
           xyz abc 6   5   4
           xyz abc 9   8   7

Now I want to be able to form a string like so:

"foo bar: 1   2   3   4   5   6   7   8   9"
"xyz abc: 3   2   1   6   5   4   9   8   7"

If it matters I also have a list of the A and B columns I can use naively by going:

Rs1 = SELECT * FROM PARENT_TABLE:
    for a, b in RS1
        String = a + b
        Rs2 = SELECT C, D, E FROM CHILD_TABLE WHERE A='a' AND B='b'
            for every row in Rs:
                String += C D E
        print String

Is there anyway to do this WITHOUT having to iterate through the parent table and then on each row form a statement and thus iterate on that one as well. Am I missing an obvious solution?

  • 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-26T02:31:14+00:00Added an answer on May 26, 2026 at 2:31 am

    You want to look up aggregate functions:

    • PostgreSQL: array_agg
    • MySQL: group_concat
    • Oracle 11g: listagg
    • Oracle 10g: listagg (workaround)
    • Oracle: group_concat (workaround)
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a google spreadsheet that looks like this, for budget keeping. I want
I'm fairly inexperienced in SQL and this seems like it must be an easy
I am a very inexperienced developer and have run into a problem that should
Very new to python and can't understand why this isn't working. I have a
very often I like to have my movieclip code inside the movieclip (on a
Very inexperienced with Flash, but I hope this is simple enough for someone to
PREFACE: I'm relatively inexperienced in C++ so this very well could be a Day
Very frustrating problem I have here. I have this code: Button b = findViewById(android.R.id.button1);
I am very new and very inexperienced. I have downloaded a WPF version of
I have an idea that sounds like it might work but I'm not entirely

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.