Site Sponsored By: SQLDSC - SQL Server Desired State Configuration
Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
for this record I want to get the 'current order'I can do it like thisSelect col1, max(col4) into temp_table from table1 group by col1.Select a.* from table1 a , temp_table t1 where a.col1 = t1.col1AND a.col4 = t1.col4..Can I do this in a single select statement.. if so howThanks"
Nazim
A custom title
1408 Posts
Posted - 2002-01-16 : 09:52:19
Using Derive Query you can do itSelect a.* from table1 a , (Select col1, max(col4) as col2from table1 group by col1 ) bwhere a.col1=b.col1 and a.col4=b.col4Hope this does what you are looking for.----------------------------------"True love stories don't have endings."