You can do this in two ways.
1) Build the logic to check for unique values yourself. In this case, everytime you insert a new row, first check if the serial number already exists. Loading them from the db before saving and then checking them would be the easiest though not the most efficient way. Other approaches could be to cache these values etc.
2) Allow the database to do this for you. Set a
UNIQUE
constrain on this serial no. column.
This[
^] should help you understand what a unique column is.
This[
^] should guide you futher and help you set up a constraint. Once this is setup, the database will not allow you to insert duplicate columns.
As a note, you should also look at primary keys -
http://www.w3schools.com/sql/sql_primarykey.asp[
^].