SQL FOREIGN KEY BETWEEN TWO TABLES

Lady Bird Johnson

Total Post:20

Points:140
Posted by  Lady Bird Johnson
 1057  View(s)
Ratings:
Rate this:
Hi Expert!

I was wondering if anyone could lead me through this SQL query.

I have two tables CS_JOBS and CS_JOBS_CATEGORY. They both have category_code row which I want to join.

PS: I will use these tables to populate the drop down box in php. 

Thank you!
  1. AVADHESH PATEL

    Post:604

    Points:4228
    Re: SQL foreign key between two tables

    Hi Lady!


    Try as following

    SELECT -- what you want to select
    FROM CS_JOBS AS j
    INNER JOIN CS_JOBS_CATEGORY AS c ON j.category_code = c.category_code;

    I hope it helpful for you.

Answer

NEWSLETTER

Enter your email address here always to be updated. We promise not to spam!