1、Mysql修改字段的默认值:

  alter table tablename alter column drop default; (若本身存在默认值,则先删除)

  alter table tablename alter column set default 0;(若本身不存在则可以直接设定)

2、修改字段的备注:

  alter table dq_permission_group_permission modify column trial_type tinyint(1) comment '备注内容';

3、查询表内某字段重复值的数量:

  select mobile,count(*) as sumcount from user group by mobile having sumcount>1; (先用手机号分组,再用having来过滤大于1的,查出来的就是重复记录)

4、修改字段的长度:

  alter table pre_common_attachments modify column user_id int(50);

5、查看表内索引:

  show indexex from table;

  show keys from table;

最新文章

  1. bug描述技巧
  2. MFC - 微软基础类库和框架
  3. window计划任务
  4. Grunt vs Gulp
  5. 【转】【WPF】WPF 自定义快捷键命令(Command)
  6. Eclipse+Tomcat部署项目的一些总结
  7. 分页加查询的sql语句
  8. memcached并发处理
  9. JAVA中,数组的操作与排序
  10. iOS基础 - 文本属性Attributes
  11. error LNK2001:unresolved external symbol "xxx:static xxx"
  12. js中__proto__和prototype的区别和关系?
  13. 两个Xml转换为DataSet方法(C#)
  14. substr函数的用法
  15. 树链剖分详解(洛谷模板 P3384)
  16. C#读取Excel文件的简单方法
  17. spring整合mybatis在使用.properties文件时候遇到的问题
  18. js判断变量的类型(使用闭包来玩一把)
  19. Kubernetes部署ELK并使用Filebeat收集容器日志
  20. Architecture And Framework

热门文章

  1. 刷题——一道全排列的题目(Permutations)
  2. 前端 CSS 盒子模型 padding 内边距 属性
  3. SpringBoot(四) -- SpringBoot与Web开发
  4. Greg and Array CodeForces 296C 差分数组
  5. 洛谷 P1073 最优贸易 & [NOIP2009提高组](反向最短路)
  6. SpringMVC Controller单例和多例(转)
  7. hdu6357 Hills And Valleys (最长不下降子序列)
  8. TAB切换与内容伸展闭合的结合
  9. vue.js(18)--父组件向子组件传值
  10. Java编码技巧与代码优化