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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T01:59:02+00:00 2026-06-07T01:59:02+00:00

Can you let me know if my interpretation is correct (the last AND part)?

  • 0

Can you let me know if my interpretation is correct (the last AND part)?

$q = "SELECT title,name,company,address1,address2 
      FROM registrations 
      WHERE title != 0 AND id IN (
          SELECT registrar_id 
          FROM registrations_industry 
          WHERE industry_id = '$industryid'
      )";

Below was really where I am not sure:

... AND id IN (select registrar_id from registrations_industry where industry_id='$industryid')

Interpretation: Get any match on id(registrations id field) equals registrar_id(field) from the join table registrations_industry where industry_id equals the set $industryid

Is this select statement considered a sub routine since it’s a query within the main query?

So an example would be with the register table id search to 23 would look like:

registrations(table)

id=23,title=owner,name=mike,company=nono,address1=1234 s walker lane,address2

registrations_industry(table)

id=256, registrar_id=23, industry_id=400<br>
id=159, registrar_id=23, industry_id=284<br>
id=227, registrar_id=23, industry_id=357

I assume this would return 3 records with the same registration table data And of course varying registrations_industry returns.

  • 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-07T01:59:05+00:00Added an answer on June 7, 2026 at 1:59 am

    For a given test data set your query will return one record. This one:
    id=23,title=owner,name=mike,company=nono,address1=1234 s walker lane,address2
    To get three records with the same registration table data and varying registrations_industry you need to use JOIN.

    Something like this:

    SELECT r.title, r.name, r.company, r.address1, r.address2 
    FROM registrations AS r
    LEFT OUTER JOIN registrations_industry AS ri
    ON ri.registrar_id=r.id
    WHERE r.title!=0 AND ri.industry_id={$industry_id}
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Can someone please let me know how to get values from several input fields?
Can someone please let me know the location to get the Java7 from IBM
can someone let me know how to run a long running process from a
Can anyone let me know how can we change the value of kendo combobox
Can anyone let me know how to set a drop down box for UITextField
Can someone let me know what is the difference between this and jQuery(this) ?
Can anyone let me know how can access an element of a list that
Can anyone let me know how to parallelize for loops using Java 5's JParallelLoops.jar
Can anyone let me know how to implement this feature specified at http://vimeo.com/24475654 Specially
Can somebody please let me know how we can determine if a local disk

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.