Home » SQL & PL/SQL » SQL & PL/SQL » Scenario: (Oracle)
Scenario: [message #629557] Wed, 10 December 2014 16:36 Go to next message
mohammed.mca09@gmail.com
Messages: 5
Registered: October 2014
Location: Bangalore
Junior Member
Stud_id Stud_name Subject Grade

----------------------------------------------------------------------------------

1 John Science C

2 Jim Math A

2 Jim Science A

1 John Math B

2 Jim Language A

1 John Language B

3 Bob Math A


output:
Stud_id Science_Grade Math_Grade Lang_Grade

1 C B B

2 A A A

3 A
Re: Scenario: [message #629558 is a reply to message #629557] Wed, 10 December 2014 16:39 Go to previous messageGo to next message
John Watson
Messages: 8931
Registered: January 2010
Location: Global Village
Senior Member
Please read our OraFAQ Forum Guide and please read How to use [code] tags and make your code easier to read You hve been asked to do this before.

Is this a college homework question? No-one is going to do that for you.

You need to show your work so far: the CREATE TABLE statements and some INSERT statements, and your attempts at the query.

[Updated on: Wed, 10 December 2014 17:04]

Report message to a moderator

Re: Scenario: [message #629559 is a reply to message #629558] Wed, 10 December 2014 17:11 Go to previous messageGo to next message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
http://www.orafaq.com/forum/mv/msg/194991/626339/#msg_626339
Re: Scenario: [message #629564 is a reply to message #629557] Thu, 11 December 2014 00:35 Go to previous message
Michel Cadot
Messages: 68648
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator

In addition, this is a standard PIVOT query (search for this keyword) and the solutions depend on your Oracle version you must post with all your questions (with 4 decimals like 11.2.0.4).

Also read test case.

Previous Topic: ora-06550
Next Topic: Query Rewrite and Self-Joins
Goto Forum:
  


Current Time: Fri May 10 02:00:00 CDT 2024