摘要: pgsql 中,表 t1 有多个字段 a1 a2 a3,相同a1 的值只查询一条数据 一、方法1 —使用 ROW_NUMBER() 窗口函数 SELECT * FROM ( SELECT *, ROW_NUMBER() OVER (PARTITION BY a1 ORDER BY a2) AS rn 阅读全文
posted @ 2025-05-20 17:51 BillyYang 阅读(83) 评论(0) 推荐(0)
摘要: pgsql 去掉字段的换行符和首尾空格 一、方法1 分部处理 1. 去掉首尾空格 使用 TRIM() 函数: UPDATE 表名 SET 字段名 = TRIM(字段名); 2. 去掉换行符 使用 REPLACE() 替换换行符: UPDATE 表名 SET 字段名 = REPLACE(字段名, CH 阅读全文
posted @ 2025-05-08 17:05 BillyYang 阅读(113) 评论(0) 推荐(0)
摘要: yarn 安装依赖时出现以下内容: The engine "node" is incompatible with this module. Excepted version "20 || >=22". Got "18.18.0" 一、问题 二、解决办法 设置 yarn 忽略engine 校验,如下: 阅读全文
posted @ 2025-01-15 16:35 BillyYang 阅读(637) 评论(0) 推荐(0)
摘要: postgre 更新json字段的某个key名称 一、更新 json 字段的某个 key 名称 update table_name set json_column = jsonb_set(json_column::jsonb, '{new_key}', json_column::jsonb -> ' 阅读全文
posted @ 2024-11-27 16:35 BillyYang 阅读(103) 评论(0) 推荐(0)
摘要: 安装nvm,可以对本地环境中的node版本进行随意切换 一、安装 nvm 下载并安装 nvm ,安装手册“【nvm文档手册 - nvm是一个nodejs版本管理工具 - nvm中文网 (uihtm.com)】 二、nvm使用 # 安装node nvm install xxx.xxx # 应用 nvm 阅读全文
posted @ 2024-11-20 21:13 BillyYang 阅读(1265) 评论(0) 推荐(0)
摘要: 一、根据属性名设置属性值 public static void setFieldValueByName(Object obj, String fieldName, Object value){ try { // 获取obj类的字节文件对象 Class c = obj.getClass(); // 获 阅读全文
posted @ 2024-09-26 17:46 BillyYang 阅读(518) 评论(0) 推荐(0)
摘要: idea启动 main 函数时,报 Command line is too long Shorten command xxx 一、解决办法 找到 .idea 下面的 workspace.xml 找到以下属性 PropertiesComponent,添加 dynamic.classpath 属性 <p 阅读全文
posted @ 2024-09-26 17:42 BillyYang 阅读(347) 评论(0) 推荐(0)
摘要: git 版本回退,用于误提交或者版本回退 一、回滚到之前的某次版本,且该版本后的提交都不要(用于版本回退) 1)、首先查看版本号,用 git log 命令查看要回退的版本对应的commit Id commit 17829e208cd170928fd0f3adb3f3bde1b1eabb76 2)、回 阅读全文
posted @ 2024-09-10 10:08 BillyYang 阅读(3148) 评论(0) 推荐(0)
摘要: git 批量删除本地分支及远程分支 一、批量删除本地分支 git branch |grep 'name' |xargs git branch -D 备注: name 为需要匹配的分支名称 二、批量删除远程分支 git branch -r | grep 'name' | sed 's/origin\/ 阅读全文
posted @ 2024-08-13 18:36 BillyYang 阅读(846) 评论(0) 推荐(0)
摘要: pgsql 查询及更新json字段的某个属性 一、查询json字段中的某个属性 查询 t_user 表中json 字段 info 中的 name 属性 select info ->> 'name' from t_user; 二、更新json字段中的某个属性 更新 info 的name属性为张三 up 阅读全文
posted @ 2024-08-01 17:27 BillyYang 阅读(590) 评论(0) 推荐(0)
点击右上角即可分享
微信分享提示