Hey Friends, I have an issue I believe some of you SQL Masters can quickly help with. Any advice is much appreciate and thanks in advance for any replys.So I have a Table with Customer ID, Type, And Method. Where type is like Invoice, Statement, Order Confirmation and Method is Email, Fax or TextSo its likeCustomerID Type Method12 Invoice Fax12 Satement Fax12 OrderConf Email12 Newsletter Text
So that info is there. Then I want to do the following query.SELECT B.CustomerID , A.[full name] , A.[business phone] , A.[mobile phone] , 'No' , 'Not Yet' , A.[e-mail 1] , case when type = 'Invoices' then C.method end as Invoices , case when type = 'Statements' then C.method end as Statements , case when type = 'Order Confirmations' then C.method end as Order_Confirmations , case when type = 'Packing Slips' then C.method end as Packing_Slips , 'N' , GetDate() , 'Frankt@Gmail.com' , 'message' --<message, varchar(400),>FROM Server.ContactsDetail A JOIN Server.ContactsView B ON A.cntctid = B.contactid JOIN Server.Communication C ON B.bsicustomerid = C.dealernoWHERE B.bsicustomerid <> ''AND A.[full name] <> ''
Finnaly, when i run that query the case is giving me a row for each type so each customer is listed like 4 times. i want each customer listed only once with each column having the corresponding value in it like so.CustomerID Newletter Invoice OrderConf Statement12 Fax Email Fax Text
How can i get it like that friends??Let me know if you have any questions.Thanks to all!!