如果那是您的意思,Rhys的答案是正确的,但是您可能想在
title()中使用
retail=MIN(retail),而该措辞建议了如何获得该答案:
SELECt title, retailFROM booksWHERe category = 'COMPUTER' AND retail = (SELECt MIN(retail) FROM books WHERe category = 'COMPUTER')
为了减少重复,可以使用
WITH子句(如果使用的是最新版本的SQL):
;WITH ComputerBooks AS ( SELECt title, retail FROM books WHERe category = 'COMPUTER')SELECt title, retailFROM ComputerBooksWHERe retail = (SELECt MIN(retail) FROM ComputerBooks)
我用来确认语法的示例。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)