• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 491
  • Last Modified:

sql query with 2 Max parameters

Hi Experts

Using an sql query I want to get a particular column value for a row that has MAX values in 2 other columns, something like:

SELECT FloatAmount, MAX(CountDate), MAX(CountDateNumber)
FROM Count


Has anyone got any idea how to do this?
0
dizzycat
Asked:
dizzycat
  • 2
1 Solution
 
pcelbaCommented:
If these two max values are in different rows then you have no solution...
If you have duplicate max values then you have many solutions...

SELECT FloatAmount, CountDate, CountDateNumber FROM Count
WHERE CountDate = (SELECT MAX(CountDate) FROM Count)
  AND CountDateNumber = (SELECT MAX(CountDateNumber) FROM Count)

So you have to better specify what is your goal.
0
 
dizzycatAuthor Commented:
That's great, thanks.
0
 
QlemoDeveloperCommented:
You should have waited for better suggestions ;-).
0
 
pcelbaCommented:
You may still post them :-)
0

Featured Post

The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now