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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T18:51:58+00:00 2026-06-17T18:51:58+00:00

I have a task to make a summary table of a few thousand other

  • 0

I have a task to make a summary table of a few thousand other tables containing thousands of records. The summary table should contain:

  1. non redundant list of “records”;
  2. number of tables containing that “record”
  3. names of tables containing that “record”

Example would be:

Table_1
nameA
nameB
nameC

Table_2
nameB
nameC
nameD

Table_3
nameC
nameD
nameE

Result should be something like this

Record_name  Number  Table_names
nameA        1       Table_1
nameB        2       Table_1, Table_2
nameC        3       Table_1, Table_2, Table_3
nameD        2       Table_2, Table_3
nameE        1       Table_3

Perhaps it is not to complicated thing to do, but, since I’m quite new to mysql, I hope to get some advice and help from you guys!

  • 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-17T18:51:59+00:00Added an answer on June 17, 2026 at 6:51 pm
    SELECT  col1 as `Record Number`, 
            COUNT(*) as `Number`, 
            GROUP_CONCAT(_name) as `table name`
    FROM
    (
        SELECT col1, 'table_1' as _name FROM table_1
        UNION ALL
        SELECT col1, 'table_2' as _name FROM table_2
        UNION ALL
        SELECT col1, 'table_3' as _name FROM table_3
    ) a
    GROUP BY col1
    
    • SQLFiddle Demo
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a task to make a survey to be displayed in SharePoint 2007
Have a task to make votes for photo. Because users can vote only one
I have a task to make some of the checkboxes in a form choice
I have a task that should be simple, Given a path, search all children
I have task to make simple app from three Views: in first: UITableView (it
I have task to make two multiple selections with drag and drop. I used
I have a task which I must make Graph API call in FQL to
I have received the task to make a social graph , where, with one
I have a task to make website article stats based on database results. I
I have a task to make people follow some account on twitter as soon

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.