Home > Database > Mysql Tutorial > body text

求一条ACCESS语句

WBOY
Release: 2016-06-07 15:44:21
Original
1118 people have browsed it

t1: SO SOL QTY 125 1 10 126 1 10 127 1 75 t2: SO SOL JOB QTY 125 1 12345 1 126 1 12346 2 127 1 12347 3 127 1 12348 4 t3: t1.SO t1.SOL t1.QTY sum(t2.QTY) 125 1 10 1 126 1 10 2 127 1 75 7 要求: 由t1+t2得到t3,条件:t1.so+t1.sol=t2.so+t2.sol

t1:

SO SOL QTY
125 1 10
126 1 10
127 1 75

t2:

SO SOL JOB QTY
125 1 12345 1
126 1 12346 2
127 1 12347 3
127 1 12348 4

t3:

t1.SO t1.SOL t1.QTY sum(t2.QTY)
125 1 10 1
126 1 10 2
127 1 75 7

要求:

由t1+t2得到t3, 条件:t1.so+t1.sol=t2.so+t2.sol (so+sol唯一)

我的思路:首先将t2根据so+sol汇总QTY。然后与t1连接。但是不知道怎么写。

 

 

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!