Quantcast
Channel: SQLServerCentral » SQL Server 2014 » Development - SQL Server 2014 » Latest topics
Viewing all articles
Browse latest Browse all 3145

How to write Query that one filed have 2 Values

$
0
0
This is My Table [code="sql"]Create table T1 (GoodId int,LocNum int)Insert into T1(GoodId,LocNum) Values (1,500) ,(1, 501) ,(1, 502) ,(2, 501) ,(2, 502) ,(3, 500) ,(3, 502) ,(4, 500) ,(4, 501) ,(4, 502)[/code]>>> I want Records that their LocNumbers Have values 500 And 501 Then The result Should be : 1 , 4 (I Dont Want 2 and 3 that have only one of these Values.)Thank you

Viewing all articles
Browse latest Browse all 3145

Trending Articles