mysql
文章平均质量分 65
hahaliu005
这个作者很懒,什么都没留下…
展开
-
About insert sql on duplicate key update
Here was a useful insert sql like this :insert into `table` (`field1`,`field2`,`field3`) values('value1','value2','value3') on duplicate key update `id`=`id`,`count`=`count`+1;It means if the values of field1,field2,field3 value1, value2,value3 are exi原创 2011-04-09 12:56:00 · 338 阅读 · 0 评论 -
mysql join syntax
There are four kinds of join syntax:1.inner join;select * from table1 inner join table2 on table1.id = table2.id;it is the same as the normal sql:select * from table1,table2 where table1.id = taable2.id;2.left outer joinselect * from table1 left outer join原创 2011-04-10 20:35:00 · 278 阅读 · 0 评论 -
mysql trigger
<br />This is about a very simply trigger but which is very useful :<br />syntax:<br />CREATE TRIGGER <trigger name> <--<br />{ BEFORE | AFTER }<br />{ INSERT | UPDATE | DELETE }<br />ON <table name><br />FOR EACH ROW<br /><the sql general statement which原创 2011-04-10 20:38:00 · 400 阅读 · 0 评论 -
Mysql transaction
<br />There's two ways for MYSQL transaction.<br />1、Use begin,rollback,commit<br />begin start a transaction<br />rollback transaction rollback<br />commit transaction commit<br />2、Set mysql ini autocommit<br />In default mysql will commit automatically.原创 2011-04-12 00:05:00 · 1222 阅读 · 0 评论 -
mysql advance query
Show table statusshow table status like 'table_name';A better way to change storage engineCREATE TABLE innodb_table LIKE myisam_table;ALTER TABLE innodb_table ENGINE=InnoDB;INSERT INTO innodb_table SELECT * FROM myisam_table;Create usergrant select,insert,原创 2011-04-11 15:15:00 · 359 阅读 · 0 评论 -
Choosing Optimal Data Types
<br />Smaller is usually better.<br />In general, try to use the smallest data type that can correctly store and repre-<br />sent your data. Smaller data types are usually faster, because they use less space<br />on the disk, in memory, and in the CPU cach转载 2011-04-11 15:26:00 · 196 阅读 · 0 评论 -
Use expect command to interact with mysql in linux system
The "expect" command is not install in some linux system default , in the ubuntu system , you can simplly tap "sudo apt-get install expect" to install this tool.And then , if you want to use to in t原创 2013-12-02 10:43:59 · 964 阅读 · 0 评论