select * from B where exists (select thID from A where A.thID=B.thID) and Price=min(Price)
select * from a inner join b on A.thID=B.thID where B.Price=min(b.Price)
另:好像PRICE 为保留字应用[price]
SELECT min(price) FROM B where A.ThID = B.ThID
select * from B where A.thID=B.thID and B.Price in (select min(B.Price) as p from B where A.thID=B.thID)
select * from b where a.thid=b.thid and min(price) 或 select * from b inner join b on (a.thid=b.thid) and min(b.price) 或 select * from b inner join b using(thid) and min(b.price) 或 select * from a natural inner join b where b.price=min(b.price)
select * INTO #TEMP from a inner join b on A.thID=B.thID SELECT MIN(#TEMP.PRICE) FROM #TEMP
Select Min(B.Price) From A,B Where A.thID=B.thID
select * from b where b.price=(select min(b.price) from a,b where a.thid=b.thid)
where exists (select thID from A where A.thID=B.thID) and Price=min(Price)
where A.thID=B.thID and B.Price in (select min(B.Price) as p from B where A.thID=B.thID)
where a.thid=b.thid and min(price)
或
select * from b inner join b
on (a.thid=b.thid)
and min(b.price)
或
select * from b inner join b
using(thid)
and min(b.price)
或
select * from a natural inner join b
where b.price=min(b.price)
SELECT MIN(#TEMP.PRICE) FROM #TEMP
Where A.thID=B.thID
where b.price=(select min(b.price) from a,b where a.thid=b.thid)