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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T01:32:37+00:00 2026-06-05T01:32:37+00:00

I need to find the users who have either a shared video credit; a

  • 0

I need to find the users who have either

  1. a shared video credit;
  2. a shared production credit; or
  3. a shared group.

This is currently the query I came up with:

SELECT profile_id FROM productions_productionmember WHERE production_id in 
    (SELECT production_id FROM productions_productionmember WHERE profile_id=?)
UNION
SELECT profile_id FROM groups_groupmember WHERE group_id in 
    (SELECT group_id FROM groups_groupmember WHERE profile_id=?)
UNION
SELECT profile_id FROM videos_videocredit WHERE video_id in 
    (SELECT video_id FROM videos_videocredit WHERE profile_id=?)

Relevant tables:

groups_groupmember
- profile_id
- group_id 

videos_videocredit
- profile_id
- video_id

productions_productionmember
- profile_id
- production_id

How can improve on this query?

  • 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-05T01:32:39+00:00Added an answer on June 5, 2026 at 1:32 am
    SELECT DISTINCT p.profile_id 
    FROM productions_productionmember p
    left outer join groups_groupmember g on g.profile_id = p.profile_id
    left outer join videos_videocredit v on v.profile_id = p.profile_id
    WHERE v.video_id is not null or g.group_id is not null
    or p.production_id in (SELECT production_id 
                         FROM productions_productionmember 
                         WHERE profile_id=?)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a many_to_many relationship between ImageShells and Users. I need to find all
How do I find out all users who have installed my canvas app ?
It's easy to find all the users ids who have trait.color = green but
This is using phpMyAdmin. I need to find the contact information for Subscribers who
I need to find the cluster size of the users hard drive, through C
I need to find the user screen width and needs to apply this width
How can I do something like this in range? User.find(14000..14500) I need to choose
In my database I have a lot of users who've misspelled their e-mail address.
INFORMIX-SQL 7.32 (SE) Linux Pawnshop App. I have some users who own several pawnshops
I have table that records logins for users. I'm having trouble finding a query

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.