Will this Group By statement work with ANSI SQL:
SELECT max(last_updated_dt) as max_dt, field1, field2, field3, field4, field5, field6, field7, field8, field9, field10, field11, field12, field13, field14, field15
INTO #temp_table
FROM myTable
GROUP BY field1, field2, field3
HAVING last_updated_dt = max(last_updated_dt)
Or do I need to put all the fields except for the date field in the group by?
Thanks,
SELECT max(last_updated_dt) as max_dt, field1, field2, field3, field4, field5, field6, field7, field8, field9, field10, field11, field12, field13, field14, field15
INTO #temp_table
FROM myTable
GROUP BY field1, field2, field3
HAVING last_updated_dt = max(last_updated_dt)
Or do I need to put all the fields except for the date field in the group by?
Thanks,