MYSQL ON DUPLICATE KEY UPDATE with more than one key? -
say have record id=1, b=20 , c=30. id primary key. insert database new record if there no record b=20 , c=30. far have set primary key id b & c? how can query? thank you.
you can create unique key on b , c with.
alter table mytable add unique myindex(b,c);
Comments
Post a Comment