if exists (select * from table1 where mid='aa')INSERT INTO table1(mid,name,msg) VALUES('aa','bb','cc')