Home » SQL & PL/SQL » SQL & PL/SQL » need help in sql query (oracle 10g)
need help in sql query [message #656935] Mon, 24 October 2016 06:32 Go to next message
harry13
Messages: 3
Registered: August 2014
Location: Bangalore
Junior Member
Hi Please help me finding the solution to the below .

The pblm is like : I have 3 columns and want to get the output like below

staty_pnt end_pnt distance
A B 3
A C 2.5
B D 2
B E 1.5
C F 2.5
C G 2.5
G H 3.5
E J 1.5

My output should be like

A 3+2.5+2+1.5+1.5
B 2+1.5+1.5
C 2.5+2.5+3.5
G 3.5
Re: need help in sql query [message #656936 is a reply to message #656935] Mon, 24 October 2016 07:00 Go to previous messageGo to next message
Roachcoach
Messages: 1513
Registered: May 2010
Location: UK
Senior Member
You really need to explain with words how the original table arrives at the desired result set.
Re: need help in sql query [message #656938 is a reply to message #656935] Mon, 24 October 2016 07:52 Go to previous message
Michel Cadot
Messages: 65387
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator

Please read OraFAQ Forum Guide and How to use [code] tags and make your code easier to read.
Align the columns in result.
Also always post your Oracle version, with 4 decimals, as solution depends on it.

With any SQL or PL/SQL question, please, Post a working Test case: create table (including all constraints) and insert statements along with the result you want with these data then we will be able work with your table and data. Explain with words and sentences the rules that lead to this result.


Previous Topic: calculate working days not beween date - merged
Next Topic: Can we update "last_update_date" on Closed\Cancelled Orders using API
Goto Forum:
  


Current Time: Wed Feb 21 06:29:18 CST 2018

Total time taken to generate the page: 0.33803 seconds