I tried using this query:
select max(revenue), bonus
from bonuses
where revenue < 8411
group by revenue
And it produces more than one row, which is what I don't want; I want only
one row, the row with the maximum revenue < 8411 (in this case, usually a
variable of course) without having to go through a rather lengthy table
query, parsing through it and finding the max.
Anyone out there know a cool mySQL or SQL trick to ensure I can only have
one row?
Thanx
Phil
select max(revenue), bonus
from bonuses
where revenue < 8411
group by revenue
And it produces more than one row, which is what I don't want; I want only
one row, the row with the maximum revenue < 8411 (in this case, usually a
variable of course) without having to go through a rather lengthy table
query, parsing through it and finding the max.
Anyone out there know a cool mySQL or SQL trick to ensure I can only have
one row?
Thanx
Phil
Comment