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.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 sql update help

Author  Topic 

armesjr
Starting Member

9 Posts

Posted - 2009-11-23 : 11:10:26
l

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2009-11-23 : 11:18:09
[code]UPDATE t
SET t.I_FROM_DT = t1.FirstDate,
t.I_thru_Dt = t1.LastDate
FROM db t
JOIN (SELECT I_CLM_ID,MIN() AS FirstDate,
MAX(t.I_thru_Dt) AS LastDate
FROM db
GROUP BY I_CLM_ID) t1
ON t1.I_CLM_ID=t.I_CLM_ID[/code]
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2009-11-23 : 12:35:33
quote:
Originally posted by armesjr

l


why did you do that? dont do this as somebody might benefit from this thread in future
Go to Top of Page

armesjr
Starting Member

9 Posts

Posted - 2009-11-23 : 12:47:12
Didnt mean too. i was trying to edit it, and by accident deleted it.
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2009-11-23 : 12:48:25
quote:
Originally posted by armesjr

Didnt mean too. i was trying to edit it, and by accident deleted it.


put it back please
Go to Top of Page
   

- Advertisement -