摘要: SELECT u.gender , count(*) FILTER (WHERE u.age > 20 and u.name like '%张') AS playedFROM users uGROUP BY u.gender; 搜索 复制 阅读全文
posted @ 2022-08-10 18:57 懂得归零 阅读(1014) 评论(0) 推荐(0) 编辑
摘要: SELECT * from ( SELECT ROW_NUMBER() OVER(PARTITION by wj ORDER BY px desc)idx,px,wj from table ) ord where ord.idx = 1 wj :关联外键 px :排序字段 ROW_NUMBER:该函 阅读全文
posted @ 2022-08-10 11:35 懂得归零 阅读(156) 评论(0) 推荐(0) 编辑