RE: sum of values from two tables

RE: sum of values from two tables

 

  

Can someone please explain to me how it is that us so called professional,
educated people can end up writing so much crap.
Leave it out chaps and let's keep things as they should be, polite,
informative, useful and even on occasions, amusing.
It would be such a shame for this group to head the same way as countless
others.

Phew...!

M


-----Original Message-----
From: Manash Baruah
[mailto:oracledba-ezmlmshield-x5392095.[Email address protected]
Sent: 07 February 2008 16:01
To: LazyDBA Discussion
Subject: RE: sum of values from two tables


Rajeev,

Its night time ...lets have some light time...
I am also agree with you...lol...

Thanks & Regards,

Manash Partim Baruah
Collaboration Platform LCS-E-commerce| DBA Team| Tech Mahindra Ltd.|
Sharda Center, 6th Floor Annex Building, Pune-4, India
www.techmahindra.com


-----Original Message-----
From: Rajeev Sharma
[mailto:oracledba-ezmlmshield-x70848631.[Email address protected]
Sent: Thursday, February 07, 2008 9:22 PM
To: LazyDBA Discussion
Subject: RE: sum of values from two tables

Hey Andrews Jain,

What do you mean by Poor Indian Surly you are the one
who never seems to help to anyone but can comments which can make a
diffrence.
Great to see your thinking and way of revert with whom anyone can see
your proficiaency level.

You will surly got mails regarding your poor revert..Andrews

This is our night time...

Where is Edwards Now!!!

Edwards!!!, I am waiting for your revert in this sweet mail??

Have a Great Day! My Dear Friend.....


-----Original Message-----
From: Andrews Jain
[mailto:oracledba-ezmlmshield-x49347039.[Email address protected]
Sent: Thursday, February 07, 2008 8:53 PM
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;
>


---------------------------------------------------------------------
TO REPLY TO EVERYBODY , PLEASE CLICK REPLY-ALL, NOT JUST REPLY To post a
dba job: http://jobs.lazydba.com To Subscribe : http://www.LazyDBA.com
To unsubscribe: http://www.lazydba.com/unsubscribe.html


---------------------------------------------------------------------
TO REPLY TO EVERYBODY , PLEASE CLICK REPLY-ALL, NOT JUST REPLY To post a
dba job: http://jobs.lazydba.com To Subscribe : http://www.LazyDBA.com
To unsubscribe: http://www.lazydba.com/unsubscribe.html




---------------------------------------------------------------------
TO REPLY TO EVERYBODY , PLEASE CLICK REPLY-ALL, NOT JUST REPLY To post a
dba job: http://jobs.lazydba.com To Subscribe : http://www.LazyDBA.com
To unsubscribe: http://www.lazydba.com/unsubscribe.html



--
This message has been scanned for viruses and dangerous content by
MailScanner, and is believed to be clean.



---------------------------------------------------------------------
TO REPLY TO EVERYBODY , PLEASE CLICK REPLY-ALL, NOT JUST REPLY To post a
dba job: http://jobs.lazydba.com To Subscribe : http://www.LazyDBA.com
To unsubscribe: http://www.lazydba.com/unsubscribe.html



============================================================================
================================================


Disclaimer:

This message and the information contained herein is proprietary and
confidential and subject to the Tech Mahindra policy statement, you may
review the policy at <a
href="http://www.techmahindra.com/Disclaimer.html">http://www.techmahindra.c
om/Disclaimer.html</a> externally and <a
href="http://tim.techmahindra.com/Disclaimer.html">http://tim.techmahindra.c
om/Disclaimer.html</a> internally within Tech Mahindra.

============================================================================
================================================


---------------------------------------------------------------------
TO REPLY TO EVERYBODY , PLEASE CLICK REPLY-ALL, NOT JUST REPLY
To post a dba job: http://jobs.lazydba.com
To Subscribe : http://www.LazyDBA.com
To unsubscribe: http://www.lazydba.com/unsubscribe.html


**********************************************************************
This e-mail is confidential and may be privileged.
It may only be read, copied and used by the intended recipient.
If you have received it in error please contact the sender immediately
by return e-mail. Please then delete the e-mail and any copies of it
and do not use or disclose its contents to any person.
**********************************************************************
Registered Office: Farncombe House, Broadway, Worcestershire, WR12 7LJ

AccuRead Limited Registered Number: 3076187 England
GSL UK Limited Registered Number: 3333860 England
Global Solutions Limited Registered Number: 3189802 England
**********************************************************************


Oracle LazyDBA home page