Heim  >  Artikel  >  Datenbank  >  求一条ACCESS语句

求一条ACCESS语句

WBOY
WBOYOriginal
2016-06-07 15:44:211120Durchsuche

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

 

 

Stellungnahme:
Der Inhalt dieses Artikels wird freiwillig von Internetnutzern beigesteuert und das Urheberrecht liegt beim ursprünglichen Autor. Diese Website übernimmt keine entsprechende rechtliche Verantwortung. Wenn Sie Inhalte finden, bei denen der Verdacht eines Plagiats oder einer Rechtsverletzung besteht, wenden Sie sich bitte an admin@php.cn