i have an Table called customer with columns like this
CustomerID primaryCustID Phonenumber Mobilenumber
1 1 11111 983433453
2 2 22222 564647844
3 3 33333 983344354
4 4 44444 983434232
5 2 55555 983436790
6 4 66666 983431111
7 4 77777 983434444
8 8 88888 983437777
9 3 99999 983439999
now i need to get output like this
CustomerID primaryCustID Phonenumber1 Mobilenumber1 Phonenumber2 Mobilenumber2
5 2 55555 983436790 22222 564647844
6 4 66666 983431111 44444 983434232
7 4 77777 983434444 44444 983434232
9 3 99999 983439999 33333 983344354
.
select e.CustomerID, m.primaryCustID ,e.Phonenumber1 "Phonenumber1",
e.Mobilenumber "Mobilenumber1", m.Phonenumber1 "Phonenumber2",
m.Mobilenumber "Mobilenumber2" from Customer e,
Customer m where e.CustomerID<>m.primaryCustID
i tried like this but not getting excepted result
any idea how to solve this,anyhelp would be great.
Thanks
Prince
You forgot to add the
joincondition that connectsprimaryCustIDwithCustomerID.