Gahh..让我沮丧。教科书要求我们在不使用相关子查询的情况下重写以下语句。
SELECT DISTINCT V.VENDOR_NAME, I.INVOICE_NUMBER, I.INVOICE_DATE, I.INVOICE_TOTAL
FROM VENDORS V
JOIN INVOICES I
ON V.VENDOR_ID = I.VENDOR_ID
WHERE I.INVOICE_DATE IN
(SELECT MIN(INVOICE_DATE) FROM INVOICES IV WHERE IV.VENDOR_ID = V.VENDOR_ID)
AND I.INVOICE_NUMBER IN
(SELECT MIN(INVOICE_NUMBER) FROM INVOICES IV WHERE IV.VENDOR_ID = V.VENDOR_ID)
ORDER BY V.VENDOR_NAME
我怎样才能做到这一点?无论如何我都想不出没有子查询来重写它:S