cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

SQL PIVOT?

Former Member
0 Likes
5,291

I have a sql that return these columns.

Material---Description---Price---Type
-------------------------------------
Test1--------Desc1--------21----Ak1--
Test1--------Desc1--------29----Ak2--
Test1--------Desc1--------31----Ak3--
Test1--------Desc1--------41----Ak4--
Test2--------Desc2--------12----Ak1--
Test2--------Desc2--------22----Ak2--
Test2--------Desc2--------31----Ak3--
Test2--------Desc2--------51----Ak4--


My question is, if it can take values from a colum and make these values to new columns and take a value from a second column to these new columns. Values for the new columns are price column. Like this:

Material---Description---Ak1---Ak2---Ak3---Ak4
----------------------------------------------
Test1--------Desc1-------21----29----31----41-
Test2--------Desc2-------12----22----31----51-

Accepted Solutions (1)

Accepted Solutions (1)

Breck_Carter
Participant

Have a look at SQL Anywhere 17's PIVOT feature.

Alternatively, try this: Crosstab, Rotate, Pivot

VolkerBarth
Contributor

Version 17?

Man, I seem to have missed something by not having taken part in the current summit:)

Vlad
Product and Topic Expert
Product and Topic Expert
0 Likes

Agree :), me too. I have heard about v17. But not much.

Breck_Carter
Participant

Yes, there is much that is cool coming in 17... there may even be room for a "Top 17 Cool New Features" article 🙂

Former Member
0 Likes

when will version 17 be released, is there somewhere you can read about the new features?

Breck_Carter
Participant

SQL Anywhere 17 may be feature-complete at the end of 2014 and released in the third quarter of 2015.

No mention has been made of a beta, and if recent history (Raspberry Pi)

is any indication,
Re SQL PIVOT "SAP don't have to show you any stinking beta!"

Answers (0)