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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T14:48:20+00:00 2026-05-22T14:48:20+00:00

Q: I have 5 or 6 tables , and i need data from these

  • 0

Q:

I have 5 or 6 tables , and i need data from these tables :
i make the following join statement to accomplish my query.

SELECT d.batch_no,d.studytype_code,d.camp_code,d.dep_code,d.start_date,d.end_date,a.year,a.term_code,c.studytype_name ,e.dep_name_ar,f.camp_name_ar
FROM llkbatch a , llkbatch_category b , mm19studytype c ,llkbatch_exception d  ,llkdepartment e,llkcamp f
WHERE   a.batch_no = b.batch_no
AND  b.studytype_code = c.studytype_code 
AND  b.batch_no = d.batch_no
AND b.studytype_code = d.studytype_code 
AND d.dep_code = e.dep_code
AND d.camp_code = f.camp_code

but i think that the join sometimes is less performance way to do things like that,is there any alternative to this in a programming way or in the database layer, i mean alternatives to joins in general and when should i go away from the joins.
thanks a lot.

  • 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-22T14:48:20+00:00Added an answer on May 22, 2026 at 2:48 pm

    There is a more modern ANSI join syntax that will make your joins more readable, but it should not affect performance:

    SELECT d.batch_no,d.studytype_code,d.camp_code,d.dep_code,d.start_date,d.end_date,
           a.year,a.term_code,c.studytype_name ,e.dep_name_ar,f.camp_name_ar
    FROM ra1batch a 
    JOIN ra1batch_category b ON a.batch_no = b.batch_no
    JOIN ra1studytype c ON b.studytype_code = c.studytype_code
    JOIN ra1batch_exception d ON b.batch_no = d.batch_no
                             AND b.studytype_code = d.studytype_code 
    JOIN rr1department e ON d.dep_code = e.dep_code
    JOIN rr2camp f ON d.camp_code = f.camp_code
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have two different tables from which I need to pull data blogs which
I have 3 tables I need to join. The contracts table is the main
I have two identical tables and need to copy rows from table to another.
I have table to test score data that I need to pivot and I
I have a table of data that I need to dynamically add a column
I have a table of time-series data of which I need to find all
I have a table into which new data is frequently inserted. I need to
I have a table of contacts and a table of postcode data. I need
I have a MySql database with three tables I need to combine in a
I have 2 tables in a DB with very similar schemas that need to

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.