I have a table say tb_load_files. It contains fields file_name, file_date,file_loc,file_status
Now, File_status cane be x or y. The requirement is there can be multiple records for x status for combination of (file_name, file_date,file_loc) but only one record for y status.
e.g.
file_name file_date file_loc status abc.txt 12-oct-07 NY X abc.txt 12-oct-07 NY X abc.txt 12-oct-07 NY Y abc.txt 12-oct-07 NY Y -- NOT ALLOWED
what could be the best way of designing these table?
a. selecting data before insert
b. trigger to check if value exists
or any other.
Please advice