Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Rows into Columns

Status
Not open for further replies.

Nejibg

Programmer
Apr 4, 2008
16
GB
I've a table that displays something like this:
clientid order OrderDate
-------- ------ ---------
1 Printer
2 mouse
1 monitor
3 printer
4 keyboard
2 keyboard

But I'd like to get this result:
Where I display the latest 4 orders in the same row.

clientid order1 order2 order3 order4
-------- ------- ------- ------ ------
1 printer monitor
2 mouse keyboard
3 printer
4 keyboard

Thanks in advance for your help.
N.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top