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

  • Home
  • SEARCH
  • 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 6067227
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T09:35:08+00:00 2026-05-23T09:35:08+00:00

I have a query where I currently get information from 2 tables like this:

  • 0

I have a query where I currently get information from 2 tables like this:

SELECT g.name 
FROM site_access b 
    JOIN groups g 
        ON b.group_id = g.id 
WHERE b.site_id = 1 
ORDER BY g.status ASC

Now I wanted to have another table with this query but this one table would return more then 1 row is that possible at all ?

All I could make was it pull 1 row from that table, the field I want is a string field and it is ok to join the result with a separator too as long as all the matchs can be pulled together in this query.

If you need more information about the tables or anything feel free to say I didnt think it would be needed as this is mostly an example of how to pull multiple rows from a join/select query.

UPDATE of what the above query would result:

Admin
Member
Banned

Now with my 3rd table each access have commands they are allowed to use so this 3rd table would list what commands each one has access to, example:

Admin - add, del, announce
Member - find
Banned - none

UPDATE2:

  • site_access

    site_id
    group_id
    
  • groups

    id
    name
    status
    
  • groups_commands

    group_id
    command_id
    
  • commands

    id
    name
    
  • 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-23T09:35:09+00:00Added an answer on May 23, 2026 at 9:35 am
    SELECT g.name, GROUP_CONCAT(c.command) AS commands
    FROM site_access b 
        JOIN groups g 
            ON b.group_id = g.id 
        JOIN groups_commands gc
            ON g.id = gc.group_id
        JOIN commands c
            ON gc.command_id = c.id
    WHERE b.site_id = 1 
    GROUP BY g.name
    ORDER BY g.status ASC
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I currently have a query that looks like this: SELECT NON EMPTY ([Measures].[TOTAL]) ON
I currently have the query running on Postgres: SELECT * FROM addenda.users WHERE users.username
I currently have a query similar to: SELECT users.fname, users.lname, sales.date FROM users LEFT
I have a select query that currently produces the following results: Description Code Price
Dear all, I have a select query that currently produces the following results: DoctorName
I currently have a bunch of SQLCHAR objects from a database query. The query
I have a select query in MySQL shown below: This query executes and produces
I have a set of MySQL tables containing information from a football management game.
I have the following problem. I am currently trying to return information from a
Hey guys I have a query that currently finds the latest comment for each

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.