1 修改某一列为自动增长
mysql> alter table Statistic add Id int(11) primary key auto_increment;
Query OK, 0 rows affected (1.91 sec)Records: 0 Duplicates: 0 Warnings: 0
2 给时间格式的 一个默认值
create table history (
ID Int AUTO_INCREMENT PRIMARY KEY,
CreateDate timestamp NULL DEFAULT NOW(),
LastModify timestamp
NULL DEFAULT NOW())
3,mysql的to_char
oracle --> mysql
to_char(sysdate,'yyyy-mm-dd')-->date_format(sysdate(),'%Y-%m-%d');
to_date(sysdate,'yyyy-mm-dd')-->STR_TO_DATE(sysdate(),'%Y-%m-%d');