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

Popular posts from this blog

haskell - Using filter on an item in a list? -

c# - When does PreApplicationStartMethod actually get triggered to run? -

tomcat6 - Exception when stopping container for a with Spring + Quartz + Tomcat web application -