How to Show the Values of a Column in a Row for Both Previous/Current Records (Doc ID 262048.1)

Last updated on JUNE 05, 2017

Applies to:

SQL*Plus - Version 8.1.7.0 to 12.1.0.1 [Release 8.1.7 to 12.1]
Information in this document applies to any platform.
Information in this document applies to any platform.

Goal

How to show the values of a column in a row for both previous/current record?
----------------------------------------------------------------------------------------------------------

Suppose a customer wants to show the:
1)  Profit in the current quarter and Last quarter in same row.
2)  Profit in the current quarter and Next quarter in same row.

Solution

Sign In with your My Oracle Support account

Don't have a My Oracle Support account? Click to get started

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms