Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
当它显示在网页上时,我们得到了包含不同产品的表格,我想首先显示最低价格而不是 <> 0 并联合到价格 = 0,然后使用 ASC 订单加入最高价格。我试图用很多查询来做到这一点。但是可以在一个查询中完成吗?
为了获得最低价格,您可以使用它,
select itemcode, price from item where price>0 order by price asc limit 1
记录最低,最高价格,将“ASC”更改为“DESC”
你可以试试这个
select top * (price) from table where price>=0 order by price