Gent_JL_D

博客园 首页 新随笔 联系 订阅 管理

在sql练习网站上看到的这个题目,感觉有点意思,记录一下

  Find the printer models having the highest price. Result set: model, price.

当时想都没想直接

 

 select model,price from Printer order by price desc limit 1;

 

然后神奇的发现,报错

 

搜正解,需求可以有多条记录,然后就想呗

  

select model,price from Printer where price =(select max(price)  from Printer);

 

posted on 2020-04-07 23:16  Gent_JL_D  阅读(214)  评论(0编辑  收藏  举报