Home Forums SQL Server 2005 T-SQL (SS2K5) Help with sql statement to delete old records for user if multiple records found RE: Help with sql statement to delete old records for user if multiple records found

  • Or

    delete a

    FROM #UserSession a

    WHERE EXISTS (SELECT NULL FROM #UserSession WHERE UserName = a.UserName AND LastUpdated > a.LastUpdated)