|
create table tblA(ID int, name varchar(15))
create table tblB(ID int, AID int, price float)
insert into tblA values(1,'Demo')
insert into tblA values(2,'Demo2')
insert into tblB values(1,1,30)
insert into tblB values(2,1,32)
insert into tblB values(3,1,26)
select tblA.id, tblA.name, tblB.id, tblB.aid, tblB.price
from tblA,tblB
where tblA.id=tblB.aid
and tblB.price = (select min(tblB.price) from tblB) |
|