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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T11:21:14+00:00 2026-05-25T11:21:14+00:00

I have a table job_to_universities with the fields id univ_id post_id 1 2 3

  • 0

I have a table job_to_universities with the fields

id  univ_id  post_id
1     2        3
2     3        3
3     5        5
4     1        8
5     2        8

I have another table job_postings with the fields

id(post_id)  is_public
1             1
2             0
3             1
4             1
5             1 
6             0
7             0
8             0

say for an university id of 5 i want to get all the jobs from the job_postings table along with the jobs that have is_public as 1 in the job_postings table and i am stuck on this.

  • 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-25T11:21:15+00:00Added an answer on May 25, 2026 at 11:21 am

    If I understand you correctly, you wish to get all job postings that are both public and related to an university. This would imply a fairly simple join:

    SELECT ... FROM job_postings NATURAL JOIN job_to_universities
    WHERE univ_id = ? AND is_public = 1
    

    If you wish to get all job postings that are either public or related to an university, you can write something along the lines of:

    SELECT ... FROM job_postings WHERE is_public = 1 
    OR post_id IN (SELECT post_id FROM job_to_universities WHERE univ_id = ?)
    

    Or use UNION DISTINCT:

    SELECT ... FROM job_postings WHERE is_public = 1
    UNION DISTINCT
    SELECT ... FROM job_postings NATURAL JOIN job_to_universities
    WHERE univ_id = ?
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a simple map/reduce job that scans one hbase table, and modifies another
I have table with 300 000 records (MyISAM). I get record from this table
I have table View with grouped style with three sections. Get information from dictionary
I have a Job table and a Contact table, I need to create another
I have a job table that holds jobs and leaddate is the field for
I have two table like this job(id,title,location,...) job_page(id,id_job,id_page,page_name) For example I want to write
I want to drop all the SQL Agent Jobs which are not currently running
Say I have a Queue table and a Job table. In the Job table
I use MySQL5.1 and I have a table where we log actions regarding jobs.
I have table that I want to remain dynamic meaning that I don't want

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.