About 42,600 results
Open links in new tab
  1. sql server - Select row with max value with having clause - Stack …

    Jan 27, 2017 · Select row with max value with having clause Asked 8 years, 9 months ago Modified 6 years, 11 months ago Viewed 4k times

  2. SQL - How to select a row having a column with max value

    SQL - How to select a row having a column with max value [duplicate] Asked 15 years, 5 months ago Modified 2 years, 5 months ago Viewed 453k times

  3. mysql - GROUP BY having MAX date - Stack Overflow

    Aug 14, 2013 · HAVING date_updated=MAX(date_updated); In the context of HAVING, MAX finds the max of each group. Only the latest entry in each group will satisfy …

  4. SQL Server: SELECT only the rows with MAX (DATE)

    Aug 19, 2011 · GROUP BY t2.OrderNo, t2.PartCode HAVING t1.DateEntered = MAX(t2.DateEntered)) This is the fastest of all the queries supplied above. The query cost …

  5. How to use MAX function in MySQL with the having clause

    May 6, 2022 · 0 You don't have to use the having at all. The query as it is without the having will bring you all the departments with the number of employees at each one. The one with the …

  6. Sql Server : How to use an aggregate function like MAX in a …

    Sep 25, 2009 · As a side note (5+ years later), the HAVING clause is actually intended for use with grouped elements. However, it works with aggregate clauses (MIN, MAX, AVG) in most …

  7. sql - Select max value of each group - Stack Overflow

    The select list has 2 fields: name and value. Name is in the group by clause and value is aggregated via max. I cannot see any version of the answer where there would have been …

  8. SQL select only rows with max value on a column [duplicate]

    SELECT id, MAX(rev) FROM YourTable GROUP BY id It's never that simple, is it? I just noticed you need the content column as well. This is a very common question in SQL: find the whole …

  9. Get records with max value for each group of grouped SQL results

    Aug 24, 2012 · How do you get the rows that contain the max value for each grouped set? I've seen some overly-complicated variations on this question, and none with a good answer. I've …

  10. SQL - Using MAX in a WHERE clause - Stack Overflow

    Sep 18, 2013 · A max computes a single value from a row set. If you put a max, or any other aggregate function into a where clause, how can SQL server figure out what rows the max …