I have the following data:
id user_id typecode
-----------------------------------
10 123 'TypeA'
11 123 'TypeB'
12 124 'TypeA'
13 124 'TypeA'
14 125 'TypeA'
15 125 'TypeB'
16 125 'TypeB'
17 125 'TypeA'
I need a query that will return user_ids for users that have more than 1 ‘TYPEA’ and/or more than 1 ‘TypeB’. (124, 125)
This is using SQL Server 2008.
I edited the query to take int to account that only TypeA or TypeB are of interest. Bum not exactly sure about this. This might return user two tiems if it hase 2 TypeA and 2 TypeB i.e.