Re: sum of values from two tables

Re: sum of values from two tables

 

  



> The debate does not seem to ebb .
> This forum is not entirely for intelligent brains as opined by one of our
> friends Jayashree. The forum is big enough to accomodate all levels of
> people seeking DBA guidance/queries. Intelligence and arrogance are
> separated by a very thin line.!!!
> Individual differences are a healthy sign and i believe people post them
> for all to see so that people react to their overtures ,as we have done in
> this case.
> Let us get along with the basics of DBA and stop rhapsodising about other
> issues.
> Thanks.
>
> Regards
> Shadab
> ----- Original Message -----
> From: "Jayashree Mohanty "
> <oracledba-ezmlmshield-x52295166.[Email address protected]
> To: "LazyDBA Discussion" <[Email address protected]
> Sent: Friday, February 08, 2008 12:28 PM
> Subject: RE: sum of values from two tables
>
>
>>I believe
>> "Intelligent persons talk about ideas, knowledgeable persons talk about
>> events, and smaller persons talk about people"
>>
>> Hence everyone can find itself in its own group. And this forum is for
>> intelligent brains only.
>>
>> Above this many people use roads for commuting but public talks about
>> only those who are enriched with everything. So if anyone is talking
>> about other one, other one should think that it deserves a point to be
>> discussed.
>>
>> Again above this if people are discussing globally then it proofs that
>> how globally you are spread.
>>
>> Best Regards
>> Jayashree Mohanty
>>
>> -----Original Message-----
>> From: Raj
>> [mailto:oracledba-ezmlmshield-x45656335.[Email address protected]
>> Sent: Saturday, September 09, 2006 11:09 AM
>> To: LazyDBA Discussion
>> Subject: RE: sum of values from two tables
>>
>> Hey Rajeev why r you wasting your energy only for that person(andy)
>> who have very poor thoughts .......chill out man........one day
>> Indias
>> super fast growing economy will sew up his poor mentality...let him to
>> speak..............you enjoy the Friday night.......chase
>>
>> regards
>> Raj
>>
>>
>> -----Original Message-----
>> From: Rajeev Sharma
>> [mailto:oracledba-ezmlmshield-x76453568.[Email address protected]
>> Sent: Thursday, February 07, 2008 10:13 PM
>> To: LazyDBA Discussion
>> Subject: RE: sum of values from two tables
>>
>>
>> Who says Indian's are poor perhaps you all don't know this:
>>
>> world's richest person is an Indian "Mukesh Ambani"
>> World's Best Doctor's are From India.
>> World's fastest growing Economy is of India.
>>
>> And Lots of things are missing here.
>>
>> Question is why American Economy is Going Down? Because Of the fault of
>> the person or the government of their country, or both? Hmmmmm!
>>
>>
>> Now I am Leaving for the Day Today!!!
>>
>> Have A Great Day to All of USA or EU! Today!!!
>>
>> (~_~)
>>
>>
>> -----Original Message-----
>> From: Edwards Ed
>> [mailto:oracledba-ezmlmshield-x56570905.[Email address protected]
>> Sent: Thursday, February 07, 2008 9:38 PM
>> To: LazyDBA Discussion
>> Subject: RE: sum of values from two tables
>>
>> Hey Kathy Wright,
>> Oh my! Phew! Ouch! Hehe. Let me see! Ahhhhhh, yes! If a person
>> is poor, is it the fault of the person or the government of their
>> country, or both? Hmmmmm! Now, that's a question!
>>
>>
>>
>> -----Original Message-----
>> From: Kathy Wright
>> [mailto:oracledba-ezmlmshield-x3712720.[Email address protected]
>> Sent: Thursday, February 07, 2008 10:53 AM
>> To: LazyDBA Discussion
>> Subject: RE: sum of values from two tables
>>
>> And don't forget, "getting money which is less than a laundry job in the
>> USA" is equivalent to a six figure salary over there because of the
>> cost of living difference. Quit bellyaching. The USA gives more
>> support and more aid to other countries than ANY OTHER COUNTRY in the
>> world. And if everyone hates us so much, why are so many people wanting
>> to get in???
>>
>>
>>
>>>>> "Palmer Simon " <oracledba-ezmlmshield-x52012420.[Email address
>> protected] 2/7/2008 9:32:16 AM >>>
>> Yeah, thanks to Westerners there are a lot more Indians employed and
>> Westerners out of work.
>>
>> Great.
>>
>> (Actually, I don't really believe that, but I thought I'd respond to
>> some drivel with some drivel.)
>>
>> -----Original Message-----
>> From: Andrews Jain
>> [mailto:oracledba-ezmlmshield-x49347039.[Email address protected]
>> Sent: 07 February 2008 15:23
>> To: LazyDBA Discussion
>> Subject: RE: sum of values from two tables
>>
>>
>> As usual this very useful discussion group might also be started by some
>> good brain from USA or EU, with the intention of helping DBA's all over
>> the world. But I feel very sorry for that now everyone came to know
>> about the working culture in India and Indian's. Here people are doing
>> support job that is giving by westerners through job outsourcing and
>> getting some money which is lesser than for a laundry job in USA. Then
>> they will start to prove who is the BEST SUPPORTER.
>>
>> By
>>
>> Another poor Indian
>>
>>
>> -----Original Message-----
>> From: Edwards Ed
>> [mailto:oracledba-ezmlmshield-x94673386.[Email address protected]
>> Sent: Thursday, February 07, 2008 8:40 PM
>> To: LazyDBA Discussion
>> Subject: RE: sum of values from two tables
>>
>> In this corner "Mike Tyson"! In this corner "Jayadas Chelur"! Your
>> "Friday Night Fights" sponsor is "Red Stripe"! hehe.
>>
>> It's Fridayyyyyyyyyyyyy! Partyyyyyyyyyy! Hehe.
>>
>>
>> Have a great Day!
>>
>>
>>
>>
>>
>> Please take a few minutes to provide feedback on the quality of service
>> you received from our staff. The Department of Education values your
>> feedback as a customer. Commissioner of Education Dr. Eric J. Smith is
>> committed to continuously assessing and improving the level and quality
>> of services provided to you.Simply use the link below. Thank you in
>> advance for completing the survey.
>>
>>
>> http://data.fldoe.org/cs/default.cfm?staff=Ed.[Email address protected]
>>
>>
>>
>>
>> -----Original Message-----
>> From: Chelur Jayadas
>> [mailto:oracledba-ezmlmshield-x62965278.[Email address protected]
>> Sent: Thursday, February 07, 2008 9:44 AM
>> To: LazyDBA Discussion
>> Subject: RE: sum of values from two tables
>>
>> Mr. Shiva,
>>
>> Obviously, you have NO clue regarding what a Scalar Subquery is.
>>
>> Before you ask someone to "First Check your Query then send.",
>> at least have the basic decency to try to understand, what the
>> original problem was and how the SQL is trying to solve it.
>>
>> I am afraid, your attitude of "If-I-don't-understand-this-sql-then
>> -it-must-be-WRONG", will not be quite helpful in your career.
>>
>> This is the test scenario I created in my Database (Oracle 9.2)
>> ---------------------------------------------------------------
>> CREATE TABLE a1 (unsec_amt NUMBER);
>> CREATE TABLE a2 (unsecua_amt NUMBER);
>>
>> INSERT INTO a1 VALUES (1);
>> INSERT INTO a1 VALUES (2);
>> INSERT INTO a1 VALUES (3);
>> INSERT INTO a1 VALUES (4);
>>
>> INSERT INTO a2 VALUES (10);
>> INSERT INTO a2 VALUES (20);
>> INSERT INTO a2 VALUES (30);
>> INSERT INTO a2 VALUES (40);
>>
>> COMMIT;
>>
>> THIS IS THE QUERY WHICH YOU *THINK* IS WRONG
>> --------------------------------------------
>> SELECT (SELECT SUM(unsec_amt) FROM a1) +
>> (SELECT SUM(unsecua_amt) FROM a2) AS total_amt
>> FROM DUAL;
>>
>> And this, by the way, this is the original problem :-
>> ------------------------------------------------------------------------
>> -
>> Please help me in writing the SQL for getting the sum of the values of
>> two columns in two tables.
>> I have 2 tables
>> A1 and A2
>> in a1 i have a col unsec_amt
>> in a2 i have a col unsecua_amt
>> how do i get the sum of all the values in unsecu_amy column for both the
>> tables
>> ------------------------------------------------------------------------
>> --
>>
>> Try it out, Sir, and figure it out (if you can).
>>
>> Here's my little piece of advice, if you find a piece of SQL which
>> you don't understand, try to create a test scenario of that in your
>> environment and test it out. Surprisingly, If it works, read the manuals
>>
>> and find out how and why, before you ask people to " First Check your
>> Query then send.".
>>
>> That way, you would not be advertising your ignorance and professional
>> incompetence in this forum.
>>
>> Jayadas
>>
>>
>> -----Original Message-----
>> From: Shiva [mailto:[Email address protected]
>> Sent: Wednesday, February 06, 2008 11:48 PM
>> To: Chelur, Jayadas
>> Subject: Re: sum of values from two tables
>>
>> You have use the Dual Table but the column name has assigned from the
>> particular Table
>> Then how the column name is find my the Database.
>>
>> First Check your Query then send.
>>
>> Chelur Jayadas wrote:
>>> Just for kicks ... :-)
>>>
>>> SELECT (SELECT SUM(unsec_amt) FROM a1) +
>>> (SELECT SUM(unsecua_amt) FROM a2) AS total_amt
>>> FROM DUAL;
>>>
>>


Oracle LazyDBA home page