当前位置:网站首页>How does MySQL merge columns?
How does MySQL merge columns?
2022-06-30 13:24:00 【CSDN Q & A】
This is the demand :
With membership form vip And order form order,
Now we can go through count Function and where Statement defines a time period , To calculate how many orders each member has traded in a specific period .
The result is like this (select count(1) from order where Time = The first 1 Zhou group by vip_name):
Member name The first 1 Zhou
nail 3
B 7
C 12
Ding 17
E 2
If you specify the time in the second week , The following results will appear ( The data is random ):
select count(1) from order where Time = The first 2 Zhou group by vip_name
Member name The first 2 Zhou
nail 5
B 2
C 1
Ding 29
E 12
What I want to do now is , The first 1 Weekly data , The first 2 The data of the week are merged in the same table , That's it :
Member name The first 1 Zhou In the second week of
nail 3 5
B 7 2
C 12 1
Ding 17 29
E 2 12
No matter how I write, I can't get the right result . What kind of thinking should be adopted to realize this ?
边栏推荐
- Development of unity script program
- Introduction to the renewal of substrate source code: the pledge amount is greatly reduced, and rocksdb can be completely disabled
- kaniko官方文档 - Build Images In Kubernetes
- Package tronapi wave field interface based on thinkphp5 PHP version -- interface document attached -20220627
- [kali] Kali system, software update (with image source)
- 逆向调试入门-PE中的VA与RVA换算04/07
- A keepalived high availability accident made me learn it again!
- 产品经理专业知识50篇(七)-如何建立一套完整的用户成长体系?
- golang 基础 —— 字符串 与 int 、int64 互转
- Basic syntax of unity script (1) - common operations of game objects
猜你喜欢

Hangzhou E-Commerce Research Institute: the official website (website) is the only form of private domain

一文讲清楚什么是类型化数组、ArrayBuffer、TypedArray、DataView等概念

你想要的异常知识点都在这里了

深度长文探讨Join运算的简化和提速

visualstudio 和sql

Unity Animator 参数

一条查询SQL是如何执行的
![[deep anatomy of C language] storage principle of float variable in memory & comparison between pointer variable and](/img/3d/5d7fafba4ff7903afbd51d6d58dcdf.png)
[deep anatomy of C language] storage principle of float variable in memory & comparison between pointer variable and "zero value"

SQL考勤统计月报表

Kaniko official documents - build images in kubernetes
随机推荐
【C语言深度解剖】float变量在内存中存储原理&&指针变量与“零值”比较
Golang foundation -- slicing several declaration methods
Package tronapi wave field interface based on thinkphp5 PHP version -- interface document attached -20220627
Definition of variables and assignment of variables in MySQL
Dark horse notes - common date API
Machine learning notes - Introduction to autocorrelation and partial autocorrelation
Read all the knowledge points about enterprise im in one article
Methodology for troubleshooting problems (applicable to troubleshooting problems arising from any multi-party cooperation)
Mysql根据经纬度查询半径多少以内的数据,画个圈圈查数据库
【系统分析师之路】第五章 复盘软件工程(敏捷开发)
On the simplification and acceleration of join operation
60 divine vs Code plug-ins!!
Introduction to the renewal of substrate source code: the pledge amount is greatly reduced, and rocksdb can be completely disabled
Tronapi- wavefield interface - source code without encryption - can be opened in two places - interface document attached - encapsulation based on thinkphp5 - detailed guidance of the author - 21:59:3
Unity脚本程序的开发
【精选】资源变现资讯、新闻、自媒体、博客小程序(可引流,开通流量主,带pc后台管理)
WTM重大更新,多租户和单点登录
为基础性语言摇旗呐喊
Mqtt ROS simulates publishing a custom message type
Unity脚本的基础语法(1)-游戏对象的常用操作