12 2024 档案
摘要:-- oracle分组排序取出每组顺序第一条 select * from ( select row_number() over(partition by user_code order by create_time desc) rn, t.* from your_table t ) where rn
阅读全文
摘要:package com.lbdz.common.utils; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.regex.Mat
阅读全文
摘要:-- oracle 列转行逗号分隔 select year, listagg(sales_amount, ',') within group (order by sales_amount) as sales_amounts from sales_data group by year
阅读全文
摘要:-- 列转行拼接 select stuff((select ','+字段名 from 表名 for xml path('')),1,1,'') -- 示例 select stuff((select ','+user_name from t_user for xml path('')),1,1,'')
阅读全文