Home » SQL & PL/SQL » SQL & PL/SQL » Addition through SQL
Addition through SQL [message #449011] Fri, 26 March 2010 04:38 Go to next message
kr_arvind
Messages: 85
Registered: April 2006
Location: Delhi
Member
Hi All,

I need help against the Input and Output thhrough Sql Query.

INPUT

Name Roll Phy Chem
A 101 10 9.9
A 101 10 .1

OUTPUT
Name Roll Phy Chem
A 101 10 10

or

OUTPUT
Name Roll Phy Chem
A 101 10 9.9
A 101 .1


Regards,
Arvind Kumar
Re: Addition through SQL [message #449012 is a reply to message #449011] Fri, 26 March 2010 04:39 Go to previous messageGo to next message
JRowbottom
Messages: 5933
Registered: June 2006
Location: Sunny North Yorkshire, ho...
Senior Member
1) Pick which output you want

2) Explain to us what you are trying to do.
Re: Addition through SQL [message #449018 is a reply to message #449011] Fri, 26 March 2010 04:50 Go to previous messageGo to next message
Michel Cadot
Messages: 64132
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
From your 2 previous topics (but I bet it is the same in the previous ones):
Michel Cadot wrote on Mon, 03 August 2009 08:35
Show us what you tried.
Before please read OraFAQ Forum Guide, especially "How to format your post?" section.
Make sure that lines of code do not exceed 80 characters when you format.
Indent the code (See SQL Formatter), use code tags and align the columns in result.
Use the "Preview Message" button to verify.
Also always post your Oracle version with 4 decimals.

Regards
Michel

Michel Cadot wrote on Tue, 08 December 2009 08:45
...
Please read OraFAQ Forum Guide, especially "How to format your post?" section.
Make sure that lines of code do not exceed 80 characters when you format.
Use the "Preview Message" button to verify.
Also always post your Oracle version with 4 decimals.

And post a working Test case with your question: create table and insert statements along with the result you want with these data.

Regards
Michel

Re: Addition through SQL [message #449022 is a reply to message #449012] Fri, 26 March 2010 05:10 Go to previous messageGo to next message
kr_arvind
Messages: 85
Registered: April 2006
Location: Delhi
Member
I want 2nd one bec i need to comparison debit and credit amount

please help
Re: Addition through SQL [message #449024 is a reply to message #449018] Fri, 26 March 2010 05:18 Go to previous messageGo to next message
kr_arvind
Messages: 85
Registered: April 2006
Location: Delhi
Member
create table tab1(name varchar2(20), roll number, phy number, che number)

INSERT INTO TAB1 ( NAME, ROLL, PHY, CHE ) VALUES (
'A', 101, 10, 9.9);
INSERT INTO TAB1 ( NAME, ROLL, PHY, CHE ) VALUES (
'A', 101, 10, 0.1);
COMMIT;


OUTPUT
Name Roll Phy Chem
A 101 10 9.9
A 101 0.1

Please help how can extract the above output

[Updated on: Fri, 26 March 2010 05:27]

Report message to a moderator

Re: Addition through SQL [message #449027 is a reply to message #449024] Fri, 26 March 2010 05:36 Go to previous messageGo to next message
JRowbottom
Messages: 5933
Registered: June 2006
Location: Sunny North Yorkshire, ho...
Senior Member
How is the output to be derived from the input?

Why are there 4 columns in the first row of the output and 3 in the second?

Tell us what you are trying to do.
Re: Addition through SQL [message #449029 is a reply to message #449027] Fri, 26 March 2010 05:41 Go to previous messageGo to next message
kr_arvind
Messages: 85
Registered: April 2006
Location: Delhi
Member
bec total marks of PHY is 10 and CHE is (9.9 and .1) 10 so we need to remove one column from PHY.

After addition of all rows PHY and CHE is equal.
Re: Addition through SQL [message #449031 is a reply to message #449029] Fri, 26 March 2010 05:43 Go to previous messageGo to next message
JRowbottom
Messages: 5933
Registered: June 2006
Location: Sunny North Yorkshire, ho...
Senior Member
That makes no sense to me whatsoever I'm afraid.
Re: Addition through SQL [message #449035 is a reply to message #449031] Fri, 26 March 2010 06:08 Go to previous messageGo to next message
Michel Cadot
Messages: 64132
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Make no sense for me either, I thought it was my english knowledge but it seems that's not this.

Maybe if OP makes the little effort to format his post and explain the output with formulas we might understand.

Regards
Michel
Re: Addition through SQL [message #449186 is a reply to message #449011] Sat, 27 March 2010 11:47 Go to previous messageGo to next message
Kevin Meade
Messages: 2101
Registered: December 1999
Location: Connecticut USA
Senior Member
What is "BEC"?

Kevin
Re: Addition through SQL [message #449419 is a reply to message #449186] Mon, 29 March 2010 08:31 Go to previous messageGo to next message
joy_division
Messages: 4642
Registered: February 2005
Location: East Coast USA
Senior Member
Kevin Meade wrote on Sat, 27 March 2010 12:47
What is "BEC"?

Kevin


Probably Bose-Einstein Condensation, as it looks like this is a physics or chemistry question.
Re: Addition through SQL [message #449425 is a reply to message #449011] Mon, 29 March 2010 08:54 Go to previous messageGo to next message
cookiemonster
Messages: 12415
Registered: September 2008
Location: Rainy Manchester
Senior Member
I assumed it was short hand for because.
Re: Addition through SQL [message #449426 is a reply to message #449425] Mon, 29 March 2010 08:57 Go to previous messageGo to next message
Kevin Meade
Messages: 2101
Registered: December 1999
Location: Connecticut USA
Senior Member
What is "SHORTHAND"?
Re: Addition through SQL [message #449430 is a reply to message #449011] Mon, 29 March 2010 09:04 Go to previous messageGo to next message
cookiemonster
Messages: 12415
Registered: September 2008
Location: Rainy Manchester
Senior Member
abbreviation
Re: Addition through SQL [message #449431 is a reply to message #449430] Mon, 29 March 2010 09:06 Go to previous messageGo to next message
Kevin Meade
Messages: 2101
Registered: December 1999
Location: Connecticut USA
Senior Member
I know what is is cookie. I am trying to be humorous while at the same time pointing out that WE DON'T DO IM-SPEAK on ORAFaq.

Sorry for the confusion.

Kevin
Re: Addition through SQL [message #449434 is a reply to message #449011] Mon, 29 March 2010 09:20 Go to previous message
cookiemonster
Messages: 12415
Registered: September 2008
Location: Rainy Manchester
Senior Member
I did wonder why you weren't following me. no worries.
Previous Topic: spooling from XML
Next Topic: Improve performance of a query
Goto Forum:
  


Current Time: Wed Dec 07 14:46:16 CST 2016

Total time taken to generate the page: 0.10676 seconds