我有两个表,我想写一个查询,它会给出我这样做的最高和最低值,但它显示''联合附近的一些错误'......(使用联合是命令。)
select TOP 1 od.productid,od.unitprice,totalprice=(od.unitprice-od.discount) from orderdetails od
inner join
orders o
on od.orderid=o.orderid
where o.orderdate between '10/7/1997' and '10/14/1997'
order by totalprice asc
union
select TOP 1 od.productid,od.unitprice,totalprice=(od.unitprice-od.discount) from orderdetails od
inner join
orders o
on od.orderid=o.orderid
where o.orderdate between '10/7/1997' and '10/14/1997'
order by totalprice asc
我究竟做错了什么?