当前位置:网站首页>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
边栏推荐
- NoSQL - redis configuration and optimization
- 项目中遇到一个有趣的事情
- FFMpeg AVBufferPool 的理解与掌握
- 第十三章 信号(三)- 示例演示
- Can the polardb MySQL fees for RDS MySQL data migration be transferred?
- Determining the subject area of data warehouse construction
- Visual studio configures QT and implements project packaging through NSIS
- ffmpeg 杂项
- 腾讯二面:@Bean 与 @Component 用在同一个类上,会怎么样?
- 【一天学awk】基础中的基础
猜你喜欢

【OpenGL】OpenGL Examples

Tencent cloud Database Engineer competency certification was launched, and people from all walks of life talked about talent training problems

Shell编程概述

How to use the plug-in mechanism to gracefully encapsulate your request hook

Linux系统Redis的安装

Questionnaire star questionnaire packet capturing analysis

New function of SuperMap iserver11i -- release and use of legend

60 个神级 VS Code 插件!!

Wechat launched the picture big bang function; Apple's self-developed 5g chip may have failed; Microsoft solves the bug that causes edge to stop responding | geek headlines

Joplin implements style changes
随机推荐
Scratch drawing square electronic society graphical programming scratch grade examination level 2 true questions and answers analysis June 2022
How do different types of variables compare with zero
Docker installation of mysql8 and sqlyong connection error 2058 solution [jottings]
Solve the problem that the server cannot be connected via SSH during reinstallation
Pharmacy management system
Redis-緩存問題
Tencent two sides: @bean and @component are used on the same class. What happens?
JMeter之性能测试流程及性能测试关注点
机器学习笔记 - 自相关和偏自相关简介
解决numpy.core._exceptions.UFuncTypeError: ufunc ‘add‘ did not contain a loop with signature matchin问题
问卷星问卷抓包分析
如何利用AI技术优化独立站客服系统?听听专家怎么说!
Mysql判断计算结果,除以100
Substrate 源码追新导读: Call调用索引化, 存储层事物化全面完成
基于ThinkPHP5封装tronapi-波场接口-PHP版本--附接口文档-20220627
MySQL判断执行条件为NULL时,返回0,出错问题解决 Incorrect parameter count in the call to native function ‘ISNULL‘,
Analysis of smart jiangcai login in Jiangxi University of Finance and Economics
[surprised] the download speed of Xunlei is not as fast as that of the virtual machine
时空预测2-GCN_LSTM
FlinkSQL自定义UDTF使用的四种方式