
数据库
王呈Cleaner
这个作者很懒,什么都没留下…
展开
-
Mysql官方文档中争对安全添加列的处理方法。Mysql Add a Column to a table if not exists
Add a Column to a table if not existsMySQL allows you to create a table if it does not exist, but does not provide a native way of a adding a column (i.e. a field) to an existing table with a te转载 2017-05-08 09:33:21 · 3658 阅读 · 0 评论 -
mysql排序(自定义排序、首字母拼音排序)
自定义排序select * from doc order by field(doc_title,'主任医师','副主任医师','主治医师','住院医师')首字母排序select * from doc order by CONVERT( doc_name USING gbk ) COLLATE gbk_chinese_ci ASC原创 2017-08-01 11:41:38 · 479 阅读 · 0 评论 -
Mysql插入数据报错java.sql.SQLException: Incorrect string value: '\xF0\x9F\x98\x8D\xE8\xBE...'
一、修改数据库1)首先修改数据字符集2)修改涉及此问题的表字段字符集 3)修改数据库连接池配置我们项目用的是阿里巴巴的DruidDataSource数据库连接池,贴一下修改位置 id="druidDataSource" class="com.alibaba.druid.pool.DruidDataSource" .....转载 2017-08-02 10:43:10 · 1932 阅读 · 0 评论 -
mysql查询某个数据库中所有的表名 列名 字段长度
SELECT TABLE_NAME as '表名', COLUMN_NAME as '列名',COLUMN_COMMENT,DATA_TYPE as '字段类型' ,COLUMN_TYPE as '长度加类型' FROM information_schema.`COLUMNS` where TABLE_SCHEMA='smarthos_ty' order by TABLE_NAME,COLUMN原创 2017-10-25 11:14:55 · 5394 阅读 · 0 评论