Mike Eghtebas
asked on
How to query using derived table and multi CTEs...
Having temp table #t contain:
Product ProdType
A x
B x
B xx
C x
D x
D xx
E x
Question: Using derived table and also CTEs (2nd solution), How to produce result like:
ProdType ProdType
B x
B xx
D x
D xx
These solutions basically ignore products with single ProdType?
T-SQL to build #t:
Product ProdType
A x
B x
B xx
C x
D x
D xx
E x
Question: Using derived table and also CTEs (2nd solution), How to produce result like:
ProdType ProdType
B x
B xx
D x
D xx
These solutions basically ignore products with single ProdType?
T-SQL to build #t:
create table #t(Product char(1), ProdType varchar(2));
Insert into #t(Product, ProdType) Values
('A', 'x')
, ('B', 'x')
, ('B', 'xx')
, ('C', 'x')
, ('D', 'x')
, ('D', 'xx')
, ('E', 'x');
Select * From #t;
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks.