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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T19:24:52+00:00 2026-06-15T19:24:52+00:00

I have to tables, users and user_services. users table -> uid name email user_services

  • 0

I have to tables, users and user_services.

users table -> uid name email
user_services -> service_id uid

now when I do inner join like this:

SELECT * FROM users INNER JOIN user_services ON users.u_id=user_services.user_id  WHERE u_id = '76'

I got 4 rows because user has 4 services() and that is ok.

My question is how to have only one row and in last column (service_id) to have:

array(1,2,3,4) / or just 1,2,3,4

If I do group by u_id I will get only one row, but in last column I will get only first service id.

  • 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-15T19:24:54+00:00Added an answer on June 15, 2026 at 7:24 pm

    This will help you to get the result .

    SELECT GROUP_CONCAT(user_services.service_id)  FROM users INNER JOIN user_services ON users.u_id=user_services.user_id  WHERE u_id = '76' group by users.u_id;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have 3 tables users(id,name),groups(id,name) and users_groups(user_id,group_id). users and groups have many to many
I have 3 tables: users (id, name) currency (id, name) accounts (id, user_id, currency_id,
I have 4 tables. Table A that has users - ( user_id, username, and
I have these tables: comments uid id pid pages pid user users id rank
I have 3 tables with the following columns : * users : user_id *
I have 2 tables: users and subscribers . The relationship of the user to
I have two tables: Users: ID, first_name, last_name Networks: user_id, friend_id, status I want
Supposing I have 3 tables: Users, Roles and UserRoles. I can fetch the user_roles
I have two tables: colleges (id) and users_colleges (user_id, college_id) I want to select
I have two tables: User and Event in a many-to-many relationship. For this I

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.