Hi all,

i have a table for instance,

systemid  |  phonenumber
   1    62222222
   1    92222222
   1    64444444
   2    91111111
   3    63333333
   3    63333333

i want my select query output to be

systemid  |  phonenumber |  phonenumber2 | phonenumber3
  1    62222222   92222222     64444444
  2    91111111
  3    63333333   63333333

I tried to find, pivot , case??
anyone could help me

Thanks in advance

Hello qwertpink ,

First of, your systemid column is might be cos ids generally are supposed to be unique. And next, a simple sql query might not work well to achieve this, so first question;

Assuming there's another entry with id 1, do you have a new column 'phonenumber4' created?

Secondly, what database is this? I think PL/SQL (Oracle) might be able to achieve this using cursors or something like that

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.