MySQL Forums
Forum List  »  Newbie

Re: How to insert only unique values?
Posted by: Peter Brawley
Date: December 17, 2016 02:18PM

> insert into tlb (col_name) values 'AAA' where ...

We can't just make up syntax. Consider reading the manual page for the Insert command.

You can guarantee that column `col' in table `tbl` contains only unique values by defining a unique index on that column ...

alter table tbl add unique index(col);

Options: ReplyQuote


Subject
Written By
Posted
Re: How to insert only unique values?
December 17, 2016 02:18PM


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.