I have two tables:
TABLE_A
personid
jobid
TABLE_B
personid
jobid
These tables will hold a person's ID and the job id of a particular job in which he/she is interested.
I want to rank the top 5 most requested jobs.
So I need to select jobid from both tables and rank the jobid's from most-to-least requested.
Here's my query. I can get it to run on a single table, but I can't get it to include both:
SELECT jobid ,count(jobid) AS rank FROM TABLE_A,TABLE_B GROUP BY jobid ORDER BY rank DESC LIMIT 5
I get the following error:
MySQL said: Column: 'jobid' in field list is ambiguous.
Many thanks in advance!