1

I wish to have a resultset with 2 columns of data coming from the same column.

select cust,date,data 
from cust_a1 where ai_code between '17' and '19';

This will return multiple rows

1234567 | 04-04-2011 | special offer
1234567 | 04-04-2011 | cheep offer
1345678 | 04-04-2011 | friday offer
1345678 | 04-04-2011 | special offer

I would like to shape it like this:

1234567 | 04-04-2011 | special offer | cheep offer
1345678 | 04-04-2011 | special offer | friday offer

How can this be done?

p.campbell
  • 98,673
  • 67
  • 256
  • 322
David
  • 11
  • 1

1 Answers1

0

This is usually known as a PIVOT

Community
  • 1
  • 1
Cade Roux
  • 88,164
  • 40
  • 182
  • 265