SQL,使用MAX()的SELECT问题. [英] SQL, SELECT using MAX() problems.

查看:306
本文介绍了SQL,使用MAX()的SELECT问题.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,我在SQL查询中遇到MAX()函数的问题.
我的桌子上有一些打印机,而且只有在价格高昂的打印机中,我才很有趣.标准添加MAX()添加到SELECT中将导致错误.此代码有效.我只是不能添加MAX(),帮助!

Hello, I have problems with MAX() function in my SQL query.
I have some printers in my table, and I''m interesting only in printer with heigh price. Standard add MAX() adding into SELECT make ERROR. This code works. I just cant add MAX(), help!

SELECT        printer.price, printer.printer_name, manufacturer.manufacturer, print_technology.print_technology, print_technology.high_quality, print_technology.portable
FROM            ((printer INNER JOIN
                         manufacturer ON printer.id_manufacturer = manufacturer.ID) INNER JOIN
                         print_technology ON printer.id_print_technology = print_technology.ID)
WHERE        (manufacturer.manufacturer = 'Microsoft')

推荐答案

GE

G.E.

SELECT   Top(1)    printer.price, printer.printer_name, manufacturer.manufacturer, print_technology.print_technology, print_technology.high_quality, print_technology.portable
FROM            ((printer INNER JOIN
                         manufacturer ON printer.id_manufacturer = manufacturer.ID) INNER JOIN
                         print_technology ON printer.id_print_technology = print_technology.ID)
WHERE        (manufacturer.manufacturer = 'Microsoft')
ORDER BY printer.price DESC 


这篇关于SQL,使用MAX()的SELECT问题.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆