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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T19:41:14+00:00 2026-06-10T19:41:14+00:00

I have three tables which i have joined ..but the manner in which i

  • 0

I have three tables which i have joined ..but the manner in which i have to display them is a little difficult for me to understand.I am trying to group them and not getting the desired result.

Sports_Name

Id |  Name
---------
1     Football
2     Cricket
3     Hockey   
4     Tenis


Teams

Id  |  Sport_Id | Team_Name
----------------------------
101      1         Manchester United
103      2         Australia
104      2         India
109      1         Real Madrid
110      3         New Zeland


Player_Name

Id  |  Team_Id |  Player_Name
------------------------------
1       101         Rooney
2       104         Tendulkar
3       103         Ponting
4       109         Ronaldo
5       101         Van Persie
6       110         Simond

I need to display this information in the following manner..

**Football**    
Manchester United -Rooney
Manchester United -Van Persie
Real Madrid -Ronaldo

**Cricket**
India-Tendulkar
Australia-Ponting

**Hockey**
New Zeland -Simond

and something similar for tenis

See this picture for details

enter image description here

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

    Is this what you want?

    SELECT sports_name.name, teams.team_name, player_name.player_name  FROM player_name
    JOIN 
      teams ON
    player_name.team_ID = teams.ID
    JOIN 
      sports_name on
    sports_name.id = teams.sport_id
    order by sports_name.name, team_name
    

    This gets all the data in order then you just need to use your presentation layer to use sports.name as group header.

    This produces

    name team_name player_name
    Cricket Australia Ponting
    Cricket india Tendulkar
    Football Man u Rooney
    Football Man u RVP
    Football Real Madrid Ronaldo
    Hockey N Z Simond

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a table which needs to link one of three seperate tables, but
I have three tables which are defined as: class User(Base): __tablename__ = 'users' id
I have three tables of concern and a query which generates the following output
I have two tables which have some transactional stuff stored in them. There will
I am trying to pull multiple columns from 3 joined tables, but I want
I have 3 tables joined and I want to write a query which returns
I have two tables, users and images which need to be joined. there is
I have a select query in which I have joined a couple of tables
I have an existing database with tables which each have 4 partitions (there are
I have a SqlServer 2008 table which has a Primary Key (IsIdentity=Yes) and three

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.