select s.* from cdb_posts s
inner join (select distinct cdb_posts.tid from cdb_posts ORDER by dateline desc limit 5) b
show processlist;
inner join (select distinct cdb_posts.tid from cdb_posts ORDER by dateline desc limit 5) b
on s.tid=b.tid
set global wait_timeout=28800;
show global variables like 'wait_timeout'; 超时时间
show global variables like 'max_allowed_packet '; 最大允许数据量
select distinct 姓名 from xs
where not exists (
select * from kc
where not exists (
select * from xs_kc
where 学号=xs.学号 and 课程号=kc.课程号)
show processlist;
kill id;
其他常用命令
http://see.xidian.edu.cn/cpp/u/mysql_ml/
^[ \t]*\n
设置该table的自增序列从1开始:
ALTER TABLE tableName AUTO_INCREMENT=1
清空表
TRUNCATE TABLE [tableName]