摘要:
SELECT object_id, SUM(CASE WHEN date_column >= CURDATE() - INTERVAL 30 DAY AND date_column < CURDATE() THEN amount ELSE 0 END) AS amount_30_days, SUM( 阅读全文
posted @ 2025-04-08 23:59
程序员の奇妙冒险
阅读(28)
评论(0)
推荐(0)
摘要:
/*获取指定id的上一条记录,我这里是以id=5为例的*/ select cid,cname from company order by cid>=5,cid desc limit 1 /*获取指定id的下一条记录,我这里是以id=5为例的*/ SELECT cid,cname from compa 阅读全文
posted @ 2025-04-08 23:58
程序员の奇妙冒险
阅读(117)
评论(0)
推荐(0)
摘要:
SELECT * FROM tb_product WHERE create_date BETWEEN STR_TO_DATE( date_format( CURRENT_DATE (), '%Y-%m-01 00:00:00' ), '%Y-%m-%d %H:%i:%s' ) AND STR_TO_ 阅读全文
posted @ 2025-04-08 23:58
程序员の奇妙冒险
阅读(20)
评论(0)
推荐(0)
摘要:
创建表 Create table If Not Exists Scores (Id int, Score DECIMAL(3,2)); insert into Scores (Id, Score) values ('1', '3.5'); insert into Scores (Id, Score) 阅读全文
posted @ 2025-04-08 23:57
程序员の奇妙冒险
阅读(45)
评论(0)
推荐(0)
摘要:
SELECT * FROM sys_menu WHERE id in ( select id from ( select t1.id, if(find_in_set(parent_id, @pids) > 0, @pids := concat(@pids, ',', id), 0) as ischi 阅读全文
posted @ 2025-04-08 23:56
程序员の奇妙冒险
阅读(55)
评论(0)
推荐(0)
摘要:
分类递归查询子节点 delimiter $$ drop function if exists get_child_categoryt$$ create function get_child_categoryt(in_id varchar(10)) returns varchar(1000) begi 阅读全文
posted @ 2025-04-08 23:55
程序员の奇妙冒险
阅读(44)
评论(0)
推荐(0)
摘要:
//status = 0 为未支付状态 select * FROM order WHERE TIMESTAMPDIFF(MINUTE,create_date,now()) > 20 AND status = 0; 阅读全文
posted @ 2025-04-08 23:52
程序员の奇妙冒险
阅读(22)
评论(0)
推荐(0)
摘要:
-- 返回的是某月某日的数量 SELECT monthDay, count( 0 ) AS numb FROM ( SELECT -- 返回的是月日 date_format( create_date, '%m-%d' ) monthDay FROM tb_product WHERE create_d 阅读全文
posted @ 2025-04-08 23:52
程序员の奇妙冒险
阅读(33)
评论(0)
推荐(0)
摘要:
Logins table: + + + | user_id | login_date | + + + | 1 | 2019-07-20 | | 1 | 2019-07-20 | | 1 | 2019-07-20 | | 2 | 2019-07-20 | | 2 | 2019-07-21 | | 2 阅读全文
posted @ 2025-04-08 23:51
程序员の奇妙冒险
阅读(16)
评论(0)
推荐(0)
摘要:
近 30天的每日活跃用户数(当天只要有一条活动记录,即为活跃用户)。 Activity table: + + + + + | user_id | session_id | activity_date | activity_type | + + + + + | 1 | 1 | 2019-07-20 | 阅读全文
posted @ 2025-04-08 23:50
程序员の奇妙冒险
阅读(52)
评论(0)
推荐(0)
摘要:
这种查询会导致全表扫描 select id,name,create_date from sys_user a where not exists (select * from sys_user b where a.name = b.name and a.create_date < create_dat 阅读全文
posted @ 2025-04-08 23:49
程序员の奇妙冒险
阅读(19)
评论(0)
推荐(0)
摘要:
drop procedure if exists init_group_val; delimiter $ create PROCEDURE init_group_val() BEGIN DECLARE group_id VARCHAR(64); -- 遍历数据结束标志 DECLARE done IN 阅读全文
posted @ 2025-04-08 23:46
程序员の奇妙冒险
阅读(28)
评论(0)
推荐(0)
摘要:
select a.id,substring_index(substring_index(a.val,',',b.help_topic_id+1),',',-1) from tbl_brand_attr_group a join mysql.help_topic b on b.help_topic_i 阅读全文
posted @ 2025-04-08 23:43
程序员の奇妙冒险
阅读(28)
评论(0)
推荐(0)
摘要:
delimiter $ create PROCEDURE phoneDeal() BEGIN DECLARE ids varchar(64); -- 遍历数据结束标志 DECLARE done INT DEFAULT FALSE; -- 游标 DECLARE cur_account CURSOR F 阅读全文
posted @ 2025-04-08 23:42
程序员の奇妙冒险
阅读(11)
评论(0)
推荐(0)
摘要:
DELIMITER $$ drop procedure if exists getCategoryAndBrandRankByOrderId $$ CREATE PROCEDURE getCategoryAndBrandRankByOrderId ( _index int, size int ) B 阅读全文
posted @ 2025-04-08 23:41
程序员の奇妙冒险
阅读(24)
评论(0)
推荐(0)
摘要:
解决MySQL sql_mode=only_full_group_by问题,this is incompatible with sql_mode=only_full_group_by错误 原因: 看一下group by的语法: select 选取分组中的列 + 聚合函数 from 表名称 group 阅读全文
posted @ 2025-04-08 23:38
程序员の奇妙冒险
阅读(258)
评论(0)
推荐(0)
摘要:
create_time 时间不超过当前系统时间 7 天的数据 select create_time from incentive_activity_pub where DATEDIFF(CURDATE(), create_time)<=7 阅读全文
posted @ 2025-04-08 23:35
程序员の奇妙冒险
阅读(43)
评论(0)
推荐(0)
摘要:
DELIMITER // drop procedure if exists sys_columns_nodes// create procedure sys_columns_nodes(in rootid int) begin declare stemp varchar(1000);/*定义一个临时 阅读全文
posted @ 2025-04-08 23:34
程序员の奇妙冒险
阅读(12)
评论(0)
推荐(0)
摘要:
select FROM_UNIXTIME(1678723200000/1000,'%Y-%m-%d %H:%i:%S') as date 输出 2023-03-14 00:00:00 阅读全文
posted @ 2025-04-08 23:31
程序员の奇妙冒险
阅读(30)
评论(0)
推荐(0)
摘要:
select exists ( SELECT * FROM hy_driver_car WHERE car_id=55 and driver_user_id <> 1 ) d 阅读全文
posted @ 2025-04-08 23:29
程序员の奇妙冒险
阅读(17)
评论(0)
推荐(0)
摘要:
brew install nginx 卸载: /usr/local/Homebrew/bin/brew uninstall nginx 需要手动删除的目录: 1、cd /usr/local/var/ 目录下的 www目录 2、cd /usr/local/etc/ 目录下的 nginx目录 1.安装完 阅读全文
posted @ 2025-04-08 14:53
程序员の奇妙冒险
阅读(75)
评论(0)
推荐(0)
摘要:
以安装node14为例 breww 安装node 使用 n 切换版本无效,去官网下载pkg 安装包没有这个问题 安装brew install node@14 卸载brew uninstall node@14 当执行brew install node@14命令。下载安装完成后会提升如下 If you 阅读全文
posted @ 2025-04-08 14:51
程序员の奇妙冒险
阅读(117)
评论(0)
推荐(0)
摘要:
  阅读全文
posted @ 2025-04-08 14:40
程序员の奇妙冒险
阅读(33)
评论(0)
推荐(0)
摘要:
AiXcoder Code Completer github copilot AI根据注释自动生成代码 murphysec 检查maven依赖包版本漏洞 MOMO Code Sec Inspector plugin 检测代码漏洞,一键修复! GitToolBox 光标点击的代码行之后显示 git 用 阅读全文
posted @ 2025-04-08 14:38
程序员の奇妙冒险
阅读(53)
评论(0)
推荐(0)
摘要:
debug模式下启动项目在Build阶段卡顿 在命令终端执行:hostname 将 打印出来的 hostname放入 /etc/hosts中, 如下 127.0.0.1 localhost iMac.local ::1 localhost iMac.local 阅读全文
posted @ 2025-04-08 14:36
程序员の奇妙冒险
阅读(24)
评论(0)
推荐(0)
摘要:
在页面 html 标签添加style="filter: grayscale(100%)"样式即可 <html style="filter: grayscale(100%)"> 主要是在 html标签中加style="filter: grayscale(100%)"样式即可实现页面暗灰色,效果如图 阅读全文
posted @ 2025-04-08 14:33
程序员の奇妙冒险
阅读(12)
评论(0)
推荐(0)
摘要:
jdk环境变量配置tools.jar # ./hadoop com.sun.tools.javac.Main WordCount.java 变量需要的环境变量配置 export HADOOP_CLASSPATH=${JAVA_HOME}/lib/tools.jar 命令方式编译java文件 创建Wo 阅读全文
posted @ 2025-04-08 14:28
程序员の奇妙冒险
阅读(104)
评论(0)
推荐(0)
摘要:
字符串前面带有f作用 例如:f"Hello, {name}!" 其含义是使用 f - 字符串将变量值嵌入到字符串中,通熟易懂就是将字符串和变量拼接起来,如下 # 定义一个变量 name = "Python" # 使用 f - 字符串将变量值嵌入到字符串中 message = f"Hello, {na 阅读全文
posted @ 2025-04-08 12:00
程序员の奇妙冒险
阅读(2)
评论(0)
推荐(0)

浙公网安备 33010602011771号