I am using phpmyadmin to insert manually rows into mysql database. I have three columns: Year, Row_number and Name. Row_number can be repeated every year but not in the same year. Is there a way to control the insert process that a Row_number will not be entered more than once per year. I know how to control for unique values for one column but not for two. I need to control it while inserting the data and not as a filter afterwords. Thank you
Asked
Active
Viewed 59 times
0
-
Take a look [HERE!](http://stackoverflow.com/questions/3798555/use-multiple-columns-as-unique-identifier-for-mysql) If I understand you correctly that should be solution for your problem... GL P.S. look this [SQL Fiddle](http://sqlfiddle.com/#!9/96f70) to see what happened when try to insert the same Year - Row_Number pair... – Aleksandar Miladinovic Aug 16 '15 at 10:01
-
Thank you Aleksandar, the solution in the link and in the Fiddle worked for me. – hans Sep 03 '15 at 05:16