DROP TABLE IF EXISTS `aaabbb`;
CREATE TABLE `aaabbb` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` char(20) NOT NULL DEFAULT '' COMMENT '站点名称',
`url` varchar(255) NOT NULL DEFAULT '',
`alexa` int(11) NOT NULL DEFAULT '0' COMMENT 'Alexa 排名',
`country` char(10) NOT NULL DEFAULT '' COMMENT '国家',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8;
增加
INSERT `aaabbb` VALUES (2,3,4,5,6); / INSERT into `aaabbb` VALUES (2,3,4,5,6);
删除
delete from `aaabbb` where id=1;
修改
UPDATE `aaabbb` set country='china' where country='CN';
排序 (默认 asc 升序 - 不加 ,desc:降序)
SELECT * FROM `capital_order_base_copy1` order by created_date asc
限制
SELECT * FROM `capital_order_base` where true limit 10
SELECT * FROM `capital_order_base` limit 10
先排序后筛选
SELECT * FROM `capital_order_base_copy1` ORDER BY created_date desc limit 3
选择唯一的 bank_name 和 bank_updatetime
SELECT distinct bank_name,bank_updatetime FROM bank_all_info_copy1;