Re: How to store data
Posted by:
Arie Nagel
Date: August 19, 2005 02:49AM
You could just make a VARCHAR field and enter a string 'code1, code2 ...coden)'
However if you want something approaching a normalized database you really should create a third table. In it you store the applicant_id and the job_code (I'm assuming these columns are primary keys in their tables). Each combination represents an interest.
Something like this:
CREATE TABLE interests(
job_id INT(4),
applicant_id INT(5),
PRIMARY KEY(job_id, applicant_id)
);
If you still want to output a comma separated list of job codes you could then use this:
SELECT GROUP_CONCAT(job_id SEPARATOR ', ') FROM interests
WHERE applicant_id = 1;
Subject
Written By
Posted
Re: How to store data
August 19, 2005 02:49AM
Sorry, you can't reply to this topic. It has been closed.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion
of Oracle or any other party.