I suspect that this cant be done with a select but if anybody could point me to any way it can be done, it would be appreciated.
I have a table with codes associated with customers. The customers can have any number of 23 different codes or NO code.
The number of codes is subject to change so i dont want to create a vew with customer_id, col1, col2....col23 or anything like that if i can avoid it.
cutsomer_codes table has
customer_id code
1001 AB
1002 BB
1003 4B
1004 TT
1001 AA
1001 BB
1001 AB
1003 AB
1004 BC
1004 CC
What would be ideal would be a view that would give me a row per customer that would list all the codes that customer has like this.
customer_codes_view
customer_id col1 col2 col3 col4
1001 AB AA BB AB
1002 BB
1003 4B AB
1004 TT BC CC
any suggestions would be appreciated
I have a table with codes associated with customers. The customers can have any number of 23 different codes or NO code.
The number of codes is subject to change so i dont want to create a vew with customer_id, col1, col2....col23 or anything like that if i can avoid it.
cutsomer_codes table has
customer_id code
1001 AB
1002 BB
1003 4B
1004 TT
1001 AA
1001 BB
1001 AB
1003 AB
1004 BC
1004 CC
What would be ideal would be a view that would give me a row per customer that would list all the codes that customer has like this.
customer_codes_view
customer_id col1 col2 col3 col4
1001 AB AA BB AB
1002 BB
1003 4B AB
1004 TT BC CC
any suggestions would be appreciated