当前位置:网站首页>MySQL implements the division of two query results
MySQL implements the division of two query results
2022-06-30 12:46:00 【Full stack programmer webmaster】
Pictured , Recently, when testing report statistics , Customer unit price to be tested , I need to calculate the total amount of goods first , Then count the total order quantity of goods , Then divide their data
Customer unit price = Total order amount / Total orders
MYSQL Calculation formula
for example :
sql1=select sum(a) from xx;
sql2=select sum(b) from xx;
select
(select sum(a) from xx)
/
(select sum(b) from xx)
Select sum(a) / sum(b)
From XXPublisher : Full stack programmer stack length , Reprint please indicate the source :https://javaforall.cn/100680.html Link to the original text :https://javaforall.cn
边栏推荐
- Flink sql控制台,不识别group_concat函数吗?
- [300+ continuous sharing of selected interview questions from large manufacturers] column on interview questions of big data operation and maintenance (II)
- How to use AI technology to optimize the independent station customer service system? Listen to the experts!
- 【一天学awk】运算符
- Construction de la plate - forme universelle haisi 3559: obtenir le codage après modification du cadre de données
- Hisilicon 3559 sample parsing: Venc
- Redis installation on Linux system
- 黑马笔记---List系列集合与泛型
- 【一天学awk】基础中的基础
- New function of SuperMap iserver11i -- release and use of legend
猜你喜欢

Redis的配置文件及新数据类型

问卷星问卷抓包分析

【驚了】迅雷下載速度竟然比不上虛擬機中的下載速度

How to use AI technology to optimize the independent station customer service system? Listen to the experts!

SuperMap iServer11i新功能----图例的发布和使用

黑马笔记---集合(Collection的常用方法与遍历方式)

Today in history: Microsoft acquires PowerPoint developers; SGI and MIPS merge
![[MySQL] MySQL installation and configuration](/img/82/8500949734e57e6a1047c4e838f625.png)
[MySQL] MySQL installation and configuration

QT MSVC installation and commissioning

Hisilicon 3559 developing common sense reserves: a complete explanation of related terms
随机推荐
【OpenGL】OpenGL Examples
【一天学awk】数组的使用
【一天学awk】基础中的基础
FlinkSQL自定义UDAF使用的三种方式
The realization of QT the flipping effect of QQ weather forecast window
Basic interview questions for Software Test Engineers (required for fresh students and test dishes) the most basic interview questions
QT implementation dynamic navigation bar
Redis-缓存问题
市值蒸发650亿后,“口罩大王”稳健医疗,盯上了安全套
Google refutes rumors and gives up tensorflow. It's still alive!
Reading the table data of Tencent documents in the applet
JMeter之事务控制器
Q-learning notes
黑马笔记---集合(Collection的常用方法与遍历方式)
RDS MySQL数据迁移PolarDB MySQL费用可以转过去吗?
Inner join and outer join of MySQL tables
【驚了】迅雷下載速度竟然比不上虛擬機中的下載速度
【 surprise】 la vitesse de téléchargement de Thunderbolt n'est pas aussi rapide que celle de la machine virtuelle
Visual studio configures QT and implements project packaging through NSIS
[qnx hypervisor 2.2 user manual]6.2.3 communication between guest and external