Show 相关
SHOW DATABASES //列出 MySQL Server 数据库。
SHOW TABLES [FROM db_name] //列出数据库数据表。
SHOW TABLE STATUS [FROM db_name] //列出数据表及表状态信息。
SHOW COLUMNS FROM tbl_name [FROM db_name] //列出资料表字段
SHOW FIELDS FROM tbl_name [FROM db_name],DESCRIBE tbl_name [col_name]。
SHOW FULL COLUMNS FROM tbl_name [FROM db_name]//列出字段及详情
SHOW FULL FIELDS FROM tbl_name [FROM db_name] //列出字段完整属性
SHOW INDEX FROM tbl_name [FROM db_name] //列出表索引。
SHOW STATUS //列出 DB Server 状态。
SHOW VARIABLES //列出 MySQL 系统环境变量。
SHOW PROCESSLIST //列出执行命令。
SHOW GRANTS FOR user //列出某用户权限
插入
要插那些字段就()哪些字段; 和 select 同理
insert into db_3g.news_article (categary_id, pic, title, content, pub_date, author, sourcefrom) select c.categary_id, c.pic, c.title, c.content, c.pub_date, c.author,c.sourcefrom from(
select a.toutiao, b.id as categary_id, a.pic, a.title, a.abstract, a.content, a.published, a.pub_date, a.author, a.sourcefrom, a.slug_url from
(
select *,1 as num from pages.news_focusarticle
union all
select *,2 from pages.news_policyarticle
union all
select *,4 from pages.news_lawarticle
union all
select *,5 from pages.news_talentsarticle
union all
select *,6 from pages.news_techarticle
union all
select *,7 from pages.news_popularscience
) as a
left join(
select * from db_3g.news_categary
) as b
on a.num = b.num
)as c;