[thelist] SQL Max Query Distinct

rudy r937 at interlog.com
Thu Nov 14 13:45:01 CST 2002


>  I am getting an error...

try

   select app, firstName, lastName, dateChanged
     from yourtable XX
    inner
     join ( select app
                 , max(dateChanged) as maxdate
              from yourtable
          group by app ) YY
       on XX.app= YY.app
      and XX.dateChanged = YY.maxdate


assuming your database is standard sql compliant and allows subqueries


rudy




More information about the thelist mailing list