Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

columns as horizontal rows in sql

2945562Mar 21 2018 — edited Mar 21 2018

Dear All,

Im writing a query to get results of my sales and stock from two different tables in sql and i want it to display as horizotal on store basis.

please see the below reference.i Achieved up to here by using CASE in SQL

DATE
SALE QTY
ITEM ID
111112113114115116117118119120121121
15-10-20173ABCD111
16-10-20175BCDEF11111
17-10-20174XCGDT1111

bUT i need another column also to display as horizontally under store numbers stock column. how i can achieve this in SQL.

I need like below format. FIRST AND STOCK AS ROWS I NEED. STORE WISE STOCK.

DATESALE QTYITEM ID111
112113114115116117118119120
121
STOCK551068246982
15-10-20173ABCD111
16-10-20175BCDEF11111
17-10-20174XCGDT1111

ANYONE HELP ME PLEASE.

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 18 2018
Added on Mar 21 2018
5 comments
2,266 views