strange group/max date question...

2004-09-10 Thread bruce
hi... i have the following select... select itemID, process, status, tblType, max(date) from historyTBL where (tblType = '3' or tblType = '2') group by tblType; it seems to work, in that it gives me the rows for the two types that i'm grouping by. the problem is that i want the row that

Re: strange group/max date question...

2004-09-10 Thread Andrew Kreps
Have you tried this: select ..., max(date) as mdate from ... where ... group by ... order by mdate desc ? I haven't tested it, but it should order the results by max date descending, giving you the greatest date first. On Fri, 10 Sep 2004 18:16:00 -0700, bruce [EMAIL PROTECTED] wrote: hi...

Re: strange group/max date question...

2004-09-10 Thread Michael Stassen
bruce wrote: hi... i have the following select... SELECT itemID, process, status, tblType, MAX(date) FROM historyTBL WHERE (tblType = '3' or tblType = '2') GROUP BY tblType; it seems to work, in that it gives me the rows for the two types that i'm grouping by. the problem is that i want the row