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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T20:37:34+00:00 2026-05-14T20:37:34+00:00

We are developing something like a social networking website. I’ve got task to do

  • 0

We are developing something like a social networking website. I’ve got task to do
‘follow me’ functionality. In our website objects are users, teams, companies, channels and groups (please don’t ask why there are groups and teams – it is complicated for me too, but teams are releated to user’s talent)

Users, teams, channels, companies and groups have all their own tables.

I have a query which gets me all the follower’s leaders like this

select
  --fo.leader_id,
  --fo.leader_type,
  us.name as user_name,
  co.name as company_name,
  ch.title as channel_name,
  gr.name as group_name,
  tt.name as team_name
from
  follow_up fo
left join users us
  on (fo.leader_id = us.id and fo.leader_type = 'user')
left join companies co
  on (fo.leader_id = co.user_id and fo.leader_type = 'company')
left join channels ch
  on (fo.leader_id = ch.id and fo.leader_type = 'channel')
left join groups gr
  on (fo.leader_id = gr.id and fo.leader_type = 'group')
left join talent_teams tt
  on (fo.leader_id = tt.id and fo.leader_type = 'team')
where
  follower_id = 83

I need to get all fields like:

  • user_name,
  • company_name,
  • channel_name,
  • group_name,
  • team_name

as one field in SELECT’s product.
I have tried to alias them all the same ‘name’ but Oracle numbered it.
Please help 🙂

  • 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-14T20:37:35+00:00Added an answer on May 14, 2026 at 8:37 pm

    Column names in a query result set must be unique. Perhaps you want one row for each user, company, channel, group and team for the given follower? In which case I’d use a query like this:

    select fo.leader_type, us.name
    from follow_up fo
    join users us
      on (fo.leader_id = us.id and fo.leader_type = 'user')
    where follower_id = 83
    UNION ALL
    select fo.leader_type, co.name
    from follow_up fo
    join companies co
      on (fo.leader_id = co.user_id and fo.leader_type = 'company')
    where follower_id = 83
    UNION ALL
    select fo.leader_type, ch.title as name
    from follow_up fo
    join channels ch
      on (fo.leader_id = ch.id and fo.leader_type = 'channel')
    where follower_id = 83
    UNION ALL
    select fo.leader_type, gr.name
    from follow_up fo
    join groups gr
      on (fo.leader_id = gr.id and fo.leader_type = 'group')
    where follower_id = 83
    UNION ALL
    select fo.leader_type, tt.name
    from follow_up fo
    join talent_teams tt
      on (fo.leader_id = tt.id and fo.leader_type = 'team')
    where follower_id = 83
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 507k
  • Answers 508k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer This answer is probably what you want. Basically, create a… May 16, 2026 at 4:12 pm
  • Editorial Team
    Editorial Team added an answer You can recommend having a quick build cycle on the… May 16, 2026 at 4:12 pm
  • Editorial Team
    Editorial Team added an answer I don't think so. ORM and objects aren't magic. If… May 16, 2026 at 4:12 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Related Questions

I'm new to Ruby on Rails...I've been playing around with developing a social networking
I'm developing something like a stopwatch, so I have to turn off that below
I'm asking for some orientation and recommendations for developing something similar like the yahoo
I'm thinking about developing online multiplayer social game. The shared state of the world
So I'm developing something that works on dynamic variables using C# 4. And I'm
I am in the middle of developing a new website with my existing site
I'm developing a web interface with seam/richfaces. Alot of the components has something akin
I'm developing a personal project. The project is finished, but now I want to
I am developing a web application, in which I have the following type of
Trying to code a basic text editor to play around with Java's file objects

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.