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

Selecting records from Table2 while counting records in Table1

$
0
0
Hi, I am a little rusty at this so wanted to check out if anyone knew a good way to do what I need which is:Table1 contains fields Groupid, UserName,Category, DimensionTable2 contains fields Group, Name,Category, Dimension (Group and Name are not in Table1)So basically I need to read the records in Table1 using Groupid and each time there is a Groupid then select records from Table2 where Table2.Category in (Select Catergory from Table1) and Table2.Dimension in (Select Dimension from Table1) In Table1 There might be 10 Groupid records all of which are different.I don't want to use a cursor so any other idea'sThanks

Viewing all articles
Browse latest Browse all 3145

Trending Articles