SQL Language (MOSC)

MOSC Banner

convert column data to rows

edited Aug 9, 2020 4:05AM in SQL Language (MOSC) 5 commentsAnswered

i create sql statement and the result is

customer

period

No_of_invoices

Cust1

Jan-2020

7

Cust1

feb-2020

9

Cust1

mar-2020

4

Cust1

apr-2020

6

Cust1

may-2020

3

Cust1

Jun-2020

2

Cust1

Jul-2020

1

Cust1

aug-2020

5

Cust1

sep-2020

5

Cust1

oct-2020

7

Cust1

nov-2020

8

Cust1

dec-2020

4

Cust2

Jan-2020

5

Cust2

feb-2020

6

Cust2

mar-2020

3

Cust2

apr-2020

2

Cust2

may-2020

1

Cust2

Jun-2020

8

Cust2

Jul-2020

9

Cust2

aug-2020

5

Cust2

sep-2020

4

Cust2

oct-2020

3

Cust2

nov-2020

2

Cust2

dec-2020

6

the customer want the output like

Jan-2020

feb-2020

mar-2020

apr-2020

may-2020

Jun-2020

Jul-2020

aug-2020

sep-2020

oct-2020

nov-2020

dec-2020

total

Cust1

7

9

4

6

3

2

1

5

5

7

8

4

61

Cust2

5

6

3

2

1

8

9

5

4

3

2

6

54

12

15

7

8

4

10

10

10

9

10

10

10

115

i need a solution .

Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

Register

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

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center