mysql
一起-看月亮
这个作者很懒,什么都没留下…
展开
-
mysql往数据库插入十万条数据
sql执行批量插入数据原创 2022-08-10 17:36:14 · 370 阅读 · 0 评论 -
特殊sql
学习sql原创 2022-06-09 17:38:16 · 83 阅读 · 0 评论 -
mysql批量新增和修改,存在就修改
INSERT INTO as_expire_management(`expire_id`,`s_expire_time`,`s_status`,`tn_expire_time`,`tn_status`,`update_by`,`update_time`) VALUES <foreach collection="list" index="index" item="item" separator=","> (#{item.exp原创 2022-03-14 14:56:26 · 2339 阅读 · 0 评论 -
sql查询一对多,某个字段返回list,或string
返回list实体类 /** 销售信息ID */ private Long smId; /** 销售员ID */ private Long salesId; /** 客户公司 */ private String clientCompony; /** 客户邮件 */ private String clientEmail; /** 客户电话 */ private String clientPhone; /** 操作人原创 2021-12-17 17:47:39 · 5763 阅读 · 2 评论 -
ONLY_FULL_GROUP_BY超详细解决方案
ONLY_FULL_GROUP_BY网上都有好多说法,说什么那个版本之上会默认开启ONLY_FULL_GROUP_BY,我们不用管自己的是那个版本,我们直接通过命令查询是否开启了ONLY_FULL_GROUP_BYmysql官网详解ONLY_FULL_GROUP_BYYou can achieve the same effect without disabling ONLY_FULL_GROUP_BY by using ANY_VALUE() to refer to the nonaggregated原创 2021-12-09 13:14:36 · 14355 阅读 · 0 评论 -
sql计算数量
计算记录中未归还的数量,同一个表计算SELECT IFNULL(SUM(c.num), 0) as num FROM (SELECT a.num - IFNULL(SUM(b.num), 0) as num FROM goods_inout_record a LEFT JOIN goods_inout_record b ON a.inout_id = b.related_id AND b.type in(3,4) <wh原创 2021-12-08 13:31:40 · 1349 阅读 · 0 评论