the problem is different that i asked earlier, so i can't use unique or primary keys for fixing that. The database is ip-address-database which contains subnet field in one table (like 192.168.5) and in other table there's host,mac and description fields (like 6,ff.ff.ff.ff.ff.ff,serverX). These tables are related with id's in both tables. When adding entries,user chooses subnet to which he want to add entries,and then the given values are inserted on correct subnet based on id-number. So because all host numbers belong to same table,there can be same host-numbers, which are related to different subnet by using id's.
For example,if adding values x,x,x to host,mac,description fields with id related to subnet 192.168.5 and there already exists same host-value,but it's related to subnet 192.168.6, it should be allowed. BUT, when adding host-value related to subnet where it exists already, this should not be allowed.
Well, long story but try to get it and please send suggestions how can i make this work.I should propably change the structure of my database?