Home  >  Article  >  Database  >  求一条ACCESS语句

求一条ACCESS语句

WBOY
WBOYOriginal
2016-06-07 15:44:211167browse

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连接。但是不知道怎么写。

 

 

Statement:
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