December 6, 2010 at 7:24 pm
I want: on my table (Department_ID nvarchar(2),Possition_ID nvarchar(2))
never occur: exists
SELECT Department_ID FROM MyTable
WHERE Possition_ID = '00'
GROUP BY Department_ID HAVING COUNT(Possition_ID) >= 2
December 6, 2010 at 7:46 pm
To all posters: please read the original thread before responding, so that you get the whole picture.
Edit: but I see the OP deleted the original post over there, and replaced it. He was wanting to implement this test in a trigger, to allow multiple occurrences of Possition_ID for each Department_ID except for Possition_ID = '00'.
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
Viewing 2 posts - 1 through 1 (of 1 total)
You must be logged in to reply to this topic. Login to reply