显示最畅销的欧洲汽车的详细信息(即制造商名称,型号名称,类型) 模型。
表:
(manufacturerID, name, region)
(modelNo, name, type, previousModel, manufacturerID)
(VIN, dateAcquired, yearBuilt, purchasedPrice, askingPrice,
currentMileage, modelNo)
(VIN, custID, agentID, dateOfSale, agreedPrice)
select ma.name as "Manufacturer Name", mo.name as "Model Name", mo.type as "Model Type"
from manufacturer ma, model mo,
inner join car c on mo.modelno = c.modelno
inner join salestransaction st on c.vin = st.vin
where ma.manufacturerid = mo.manufacturerid
having (
select st.vin
from salestransaction st
inner join car c on st.vin = c.vin
group by st.vin
order by count(*) desc
)
rownum=1;
我觉得我犯了多个错误,因为我不太确切知道如何解决这个问题。
任何帮助将不胜感激。
答案 0 :(得分:1)
我认为你在寻找类似的东西:
DELETE * FROM tblTransactions
WHERE TxCode = "ICTS"
AND transaction_date IN (SELECT transaction_date
FROM tblTransactions
WHERE TxCode = "IRFC")`
我没有测试,所以你需要检查语法和表名。