I have customer table,having columns as Cust_id,Type_contact,contact.
Eg: Cust_id type_contact contact
10 Email firstname.lastname@example.org
10 Mobile 9902514139
10 Telephone 080-2434136
But I need output as :cust_id type_contact contact
10 Email-mobile-telephone email@example.com
Could anyone please tell me how to acheive this by using CASE statement.I dont need With Recursive .
Now I got the result what i expect. I appreciate a lot.
Thank u once again...
This is the final question about transpose rows to columns.
I have a table with columns as
cust_id contact_type1 contact_type2 contact_type3 contact1 contact2 contact3
100 email mobile telephone firstname.lastname@example.org 99666778 6666564
But I need output as: cust_id contact_type contact
100 email email@example.com
100 mobile 990901641
100 telephone 6666564
Could you please raja ,pls help me out by sharing solution to my question..
Thanks in advance.....
select cust_id,contact_type1 as contact,contact1 from TEST_123
select cust_id,contact_type2 as contact ,contact2 from TEST_123
select cust_id,contact_type3 as contact,contact3 from TEST_123
Why CASE?Case is built on business logic.
Is this what you are thinking of that if contact has @ then type of contact is email, if contact has something like >=9 digits then mobile, if contact has <9 digits then telephone? or somethign else?
You can filter with "case when " from your data available for each field. Once that is done you can use union all.