![](https://img-blog.csdnimg.cn/20201014180756754.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
mysql
手揽回忆怎么睡
这个作者很懒,什么都没留下…
展开
-
MySQL以逗号分隔查出关联表
SELECT a.*, GROUP_CONCAT( b.`name` ) usernameFROM sacw_auth_ac a inner JOIN ( select u.*,na.`name` from sys_user u,t_real_name_authentication na where u.account_id = na.id_number ) b ON FIND_IN_SET( b.face_id, a.auth_user ) GROUP BY a.id原创 2022-02-17 20:57:39 · 928 阅读 · 0 评论 -
查询7天sql
SELECT t.stime ,CASE WHEN ISNULL(u.forum_count) THEN '0' ELSE u.forum_count END AS count FROM ( SELECT DATE_SUB(CURDATE(), INTERVAL 1 DAY) AS stime UNION SELECT DATE_SUB(CURDATE(), INTERVAL 2 DAY) AS stime UNION SELECT DATE_SUB(CURDATE(), INTERVA原创 2021-09-06 19:00:40 · 114 阅读 · 0 评论 -
根据查询未读的活动评论或回复
– 根据查询未读的活动评论或回复select t1.id, pid, t1.`status`, t1.user_id , t2.avatar , t2.nick_name , content , t3.title, CASE WHEN pid is null THEN 'reply' ELSE 'comment'END as type,CASE WHEN pid is null THEN nullELSE (select content from cms_activity_com原创 2021-08-31 16:40:33 · 79 阅读 · 0 评论 -
Failed to configure a DataSource: ‘url‘ attribute is not specified and no embedded datasource could
配置数据源失败:找不到url属性如果你不想配置数据数据,那pom文件应该排除关于数据库的依赖,如:也可以排除对于数据库的*AutoConfigure类,@SpringBootApplication(exclude={DataSourceAutoConfiguration.class, DruidDataSourceAutoConfigure.class})排除权限认证自动配置:@SpringBootApplication(exclude={SecurityAutoConfigur原创 2021-08-02 12:01:36 · 114 阅读 · 0 评论 -
sql查询在A表但不在B表的数据
sql查询:存在A表而不在B表中的数据A、B两表,找出ID字段中,存在A表,但是不存在B表的数据。方法一:使用 not inselect distinct A.ID from A where A.ID not in (select ID from B)方法二:使用 left join...on... , "B.ID isnull" 表示左连接之后在B.ID 字段为 null的记录select A.ID from A left join B on A.ID=B.ID where B.ID ...原创 2021-07-23 15:49:29 · 9926 阅读 · 0 评论