MySQL 技巧合集 (更新)
1、 统计每列不同值出现的频数SELECT column_name,count(*) num FROM table_name GROUP BY column_name
2、 查询所有字段名select COLUMN_NAME,DATA_TYPE,COLUMN_COMMENT from information_schema.COLUMNS where table_name = '表名' and table_schema = '数据库名称';
3、 将查询结果插入表
https://blog.csdn.net/u011262253/article/details/87954421
4、 数据库的导入和导出
https://blog.csdn.net/u011262253/article/details/78319341
5、 数据库密码重置
https://blog.csdn.net/u011262253/article/details/72152639
6、 数据库去重查询SELECT DISTINCT column_name FROM table_name
SELECT column_name FROM table_name GROUP BY column_name
7.去重留一SELECT go_id, go_term, category,tax_id from ncbi_gene_go_hg_mm_main GROUP BY go_id HAVING count(*) > 1
本博客所有文章除特别声明外,均采用 CC BY-NC-SA 4.0 许可协议。转载请注明来自 白墨!
评论