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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T10:41:32+00:00 2026-06-15T10:41:32+00:00

I have 6 tables and I am going to do a single sql statement:

  • 0

I have 6 tables and I am going to do a single sql statement:

1)participant
  ***********
  +id_participant
  +id_poste
  +name
  +email

2) profile_formaion
  ****************
  +id_poste
  +id_formation

3) formation
  *********
  +id_formation
  +lable

4) poste
  *********
  +id_poste
  +label

5) session
  *********
  +id_session
  +id_formaion
  +lable

6) session_composition
  *********
  +id_session
  +id_participant

EXAMPLE:

DATA:participant

1 | 2 | user1 | user1@mail.com
2 | 3 | user2 | user2@mail.com

DATA:profile_formation

2 | 3
2 | 4

DATA:formation

1 |formation1
2 |formation2
3 |formation3
4 |formation4

DATA: poste

1 |Poste1
2 |Poste2
3 |Poste3

DATA:session

1 |1   /* id_session 1 to id_formation 1  and id_formation=1 is formation1 */

DATA:session_composition

1 |2  /* id_session 1 to id_participant 2 */

I am trying:

SELECT 
    participant.id_participant,
    participant.id_poste,
    participant.name,
    participant.email,
    formation.lable 
FROM participant
INNER JOIN profile_formaion ON
    profile_formaion.id_poste = participant.id_poste 
INNER JOIN formation ON
    formation.id_formation = profile_formaion.id_formation

How can I use sql statement(join) to get the result:

DATA:result

1 | 2 | user1 | user1@mail.com | poste2|formation3
1 | 2 | user1 | user1@mail.com | poste2|formation4
2 | 3 | user2 | user2@mail.com | poste3|formation1 // How can we join to get it.
  • 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-15T10:41:33+00:00Added an answer on June 15, 2026 at 10:41 am

    If your not averse to using unions, you can always do this:

    select
        participant.id_participant,
        participant.id_poste,
        participant.name,
        participant.email,
        poste.label,
        formation.lable
    from
        participant
        inner join poste on participant.id_poste = poste.id_poste
        inner join profile_formaion on participant.id_poste = profile_formaion.id_poste
        inner join formation on profile_formaion.id_formation = formation.id_formation
    
    union all
    
    select
        participant.id_participant,
        participant.id_poste,
        participant.name,
        participant.email,
        poste.label,
        formation.lable
    from
        participant
        inner join poste on participant.id_poste = poste.id_poste
        inner join session_composition on participant.id_participant = session_composition.id_participant
        inner join session on session_composition.id_session = session.id_session
        inner join formation on session.id_formaion = formation.id_formation
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have tables Product ( ID, CategoryID, ... ) Category ( ID, Name, ..
I have a few SQL Server tables with a datetime field that really only
I have a single row of data in a SQL Server table that I'm
I am looking to execute SQL SELECT statement inside a single cell in Excel,
My SQL Compact database is very simple, with just three tables and a single
I have two tables users with columns: uid, name, mail, etc users_roles with columns:
I have three table views inside a view controller (going to show/hide table views
so here's what's going on. I have a table that is created in code-behind
I have tables A and B with identity PKs ida and idb : ex
I have tables like these two test_table date student test 2012-05-31 Alice Math 2012-05-31

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.