June 25, 2014 at 2:34 pm
I'm a little confused to your request. What do you mean 'by group'?
Never stop learning, even if it hurts. Ego bruises are practically mandatory as you learn unless you've never risked enough to make a mistake.
For better assistance in answering your questions[/url] | Forum Netiquette
For index/tuning help, follow these directions.[/url] |Tally Tables[/url]
Twitter: @AnyWayDBA
June 25, 2014 at 3:36 pm
Assuming by "group" you're referring to the AuditTeamID, I think this gets you what you need.
;with qry as
(
Select 5 AS InternalAuditTeamEmployeeID, 1 as InternalAuditTeamID
UNION ALL
Select 11, 2
UNION ALL
Select 14, 3
)
update a
set flag = 1
from tblInternalAuditTeamEmployee a
inner join qry b
on a.InternalAuditTeamID = b.InternalAuditTeamID
and a.InternalAuditTeamEmployeeID <= b.InternalAuditTeamEmployeeID
June 25, 2014 at 4:19 pm
Sorry about leaving the specifics of the group out. Before submitting, I read my post and it made sense to me - of course. Sorry I missed the details. JeeTee's solution is spot on to what I was trying to achieve. I've never used anything on an inner join other than the = operator and didn't even realize I could (sometimes I completely miss the simple things :-)). Thank you for the solution, and for helping me learn something new today!
Thanks,
Kevin
Viewing 3 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply