Monday 26 August 2013

MySQL filling out values from other tables

MySQL filling out values from other tables

I have a table called vacancy which looks like so

role company location each have a table of there own but I would like to
get a query together to pull the information from the other tables to fill
in vacancy
I tried
SELECT r.title, c.company, l.town, l.country, v.term
FROM role r, vacancy v, location l, company c
But this gives my 300 rows of the same title when i should in fact have 3
rows returning.
company
role
location

No comments:

Post a Comment