如果我有一對夫婦的表像下限制註冊數量
Table1
-----------------------------
Name Qty
-----------------------------
John 1
Paul 2
...
Ringo 1
和
Table2
-----------------------------
Forename Surname Cost
-----------------------------
John Smith 123
John Jones 815
Paul Smith 273
Paul Jones 297
...
Ringo Smith 755
Ringo Jones 334
,我想建立一個查詢,以便數量從表2返回各子集由有序Table2.Cost並受限於Table1.Qty,返回類似於:
Results
-----------------------------
Forename Surname Cost
-----------------------------
John Jones 815
Paul Jones 297
Paul Smith 273
Ringo Smith 755
有沒有辦法做到這一點?
你的結果是什麼邏輯?你可以寫你的查詢,並讓我們知道錯誤邂逅 – Ravi
@Ravi不容易看到,但他想要最昂貴的Jhon,最昂貴的Paul 2和最昂貴的Ringo。 –