摘要:
mysql> select date_add('2017-01-01',interval 125000 second) dt1, -> date_add('2017-01-01',interval 2*125000 second) dt2, -> date_add('2017-01-01',inte 阅读全文
摘要:
mysql> select case when created_time >= '2017-01-01' -> and created_time < '2017-01-02 10:43:20' -> then '2017-01-01'(http://www.amjmh.com/v/BIBRGZ_55 阅读全文
摘要:
truncate t_target; insert into t_target select distinct t1.* from t_source t1, (select min(item_id) item_id,created_time,item_name from t_source group 阅读全文
摘要:
set @a:='1000-01-01 00:00:00'; set @b:=' '; truncate t_target; insert into t_target select * from t_source force index (idx_sort) where (@a!=created_t 阅读全文
摘要:
MySQL 8中新增的窗口函数使得原来麻烦的去重操作变得很简单。 truncate t_target; insert into t_target select item_id, created_time, modified_time, item_name, other from (select *, 阅读全文
摘要:
-- 建立源表create table t_source ( item_id int, created_time datetime, modified_time datetime, item_name varchar(20), other varchar(20) ); -- 建立目标表create 阅读全文
摘要:
set @a:='1000-01-01 00:00:00'; set @b:=' '; set @f:=0; truncate t_target; insert into t_target select item_id,created_time,modified_time,item_name,oth 阅读全文
摘要:
- 建立created_time和item_name字段的联合索引create index idx_sort on t_source(created_time,item_name,item_id); analyze table t_source; (1)使用相关子查询truncate t_targe 阅读全文
摘要:
truncate t_target; insert into t_target (http://www.my516.com)select distinct t1.* from t_source t1, (select min(item_id) item_id,created_time,item_na 阅读全文
摘要:
truncate t_target; insert into t_target select distinct t1.* from t_source t1 where item_id in (select min(item_id) from t_source t2 where t1.created_ 阅读全文