查询oracle数据库所有表数据量

select t.table_name,t.num_rows from user_tables t ORDER BY t.num_rows desc

查询postgresql数据库所有表数据量

select table_schema || '.' || table_name as table_full_name,
pg_size_pretty(pg_total_relation_size('"' || table_schema || '"."' || table_name || '"')) as size
from information_schema.tables
order by
pg_total_relation_size('"' || table_schema || '"."' || table_name || '"') desc

改变配置

pg_ctl reload

分组取前几条:

https://blog.csdn.net/a258831020/article/details/48497929

select t.* from (select serial_group_id, total,year, month, row_number() over(partition by serial_group_id ORDER BY year desc,month desc) as row from ap_serial_group_sales ORDER BY year desc) t where  row<=1

相加:

(coalesce(t.local_price,0)+coalesce(t.manu_price,0)+coalesce(t.country_price,0)) btotal

逗号合并:

select  array_to_string(ARRAY(SELECT unnest(array_agg(t.id)) ),',')
from (
select n.id
from ap_group_photo_node n
left join ap_group_photo_node_ex ex on ex.group_photo_node_id = n.id
left join ap_photo p on n.id = p.group_photo_node_id
where n.enabled = 1 and n.deleted = 0 and n.photo_amount > 0 and p.enabled=1
group by n.id
order by n.id
limit 100
) t

相同id的合并值:

https://my.oschina.net/Kenyon/blog/86609

最新文章

  1. MongoDB数据库的CURD的一些基本语句
  2. 第 21 章 CSS3 文本效果
  3. golang笔记——命令
  4. 实现自己的js框架
  5. 1小时vpn coding让开发更简单 或https://www.imfreevpn.org/
  6. 【BZOJ】【1018】【SHOI2008】堵塞的交通traffic
  7. 在CentOS 5.8上搭建PPTP VPN服务
  8. Android(java)学习笔记99:android的短信发送器研究
  9. MySql的安装与使用
  10. .NET Mvc Razor
  11. 关于Java中面向对象章节、IO 流中的重点基础知识。
  12. http://codeforces.com/contest/838/problem/A
  13. springboot注解使用说明
  14. java之jsp内置对象
  15. 图像检索(4):IF-IDF,RootSift,VLAD
  16. 时间字符串格式化 js
  17. Confluence 6 你模板中可用的对象
  18. jquery绑定回车事件
  19. 黑马java课程2222
  20. php获取POST数据的三种方法

热门文章

  1. 手机Soc芯片简介
  2. Mina的IoBuffer改造成Netty的ByteBuff
  3. C#基础第六天
  4. 【公众号系列】两分钟学会SAP F1技巧
  5. UITableView编辑模式大全解
  6. windows下scrapy安装问题,以及Twisted安装报错(error: Microsoft Visual C++ 14.0 is required.)完美解决办法
  7. AD域安装及必要设置
  8. 用SQL语句实现:当A列大于B列时选择A列否则选择B列,当B列大于C列时选择B列否则选择C列。
  9. 全民抵制“辱华”品牌秀,D&amp;G神回复:呵呵~ 那不是我!
  10. websocket 实现单聊群聊 以及 握手原理+加密方式