Databases :: MySql :: selecting max(revenue) < 8411 |
|||
| By: FiatLink |
Date: 19/12/2004 11:44:51 |
Points: 20 | Status: Answered Quality : Excellent |
|
My query is producing multiple results and it's supposed to only produce a single line. I want to get the max revenue from bonus where revenue < 8411 select max(revenue) as rev from bonus group by rev having rev < 8411 This produces every row in bonus where revenue < 8411, which can be a very large query; I only want the maximum value of rev < 8411. How can that be done; I'm using mySQL 3.23.41 Thanx |
|||
| By: Bernard | Date: 19/12/2004 11:48:52 | Type : Answer |
|
| this should work : SELECT MAX(revenue) FROM bonus WHERE revenue < 8411 |
|||
| By: VGR | Date: 19/12/2004 12:00:47 | Type : Comment |
|
| absolutely Lesson : try to stay simple ;-) |
|||
|
Do register to be able to answer |
|||
©2010 These pages are served without commercial sponsorship. (No popup ads, etc...). Bandwidth abuse increases hosting cost forcing sponsorship or shutdown. This server aggressively defends against automated copying for any reason including offline viewing, duplication, etc... Please respect this requirement and DO NOT RIP THIS SITE.
Please DO link to this page!








