1 2 Previous Next 15 Replies Latest reply: Feb 14, 2006 9:21 AM by cd_2 RSS

    How to form a query for this requirment

    487833
      Hi Friends,
      I have a database table in which I store the employee data along with his phone number. Now this row of data can repeat for different phone number depending on if it is office phone or home phone or cell phone.

      But in the output of query, I need name of empoyee and other three columns namely "Home Phone", "Office Phone" and "Cell Phone".
      If employee has three rows for each kind of phone, then in the result of query all three columns for phone numbers should be filled, otherwise as many columns should be filled with data as different phone numbers employee has.

      Can any one please post SQL query for this scenario ?

      Thanks in Adavance
        1 2 Previous Next