SQL statements
Date: Wed, 4 Dec 2013 19:01:29 +0000
Message-ID: <57297719FBD35048BA7351614E981EB217BA6FF5_at_MSGEXOXM1102.ent.wfb.bank.corp>
Hello Experts -
I wonder if I can ask with you about the syntax of sql statement to get the right results for the following scenario:
Scenario :
Given the following two tables:
clients (id (PK), name)
transactions (id (PK), client_id, trans_date, debit, credit, comment)
transactions.client_id references clients.id
What is precise sql statements which selects the balance for ALL clients, even if they have no transactions. (Assume initial balances to be zeros).
Sample table contents:
clients:
id name
-- ------
1 Pit-bull
2 Jennifer
3 Casper
transactions:
id client_id trans_date debit credit comment
-- --------- ---------- ------- ------- ----------------- 1 | 1 06/16/2013 NULL 1000.00 SALARY 2 | 1 06/18/2013 516.43 0.00 MOB PHONE PAYMENT 3 | 2 06/16/2013 NULL 1000.00 SALARY
4 | 2 06/18/2013 200.00 NULL INTERNET PAYMENT 5 | 2 06/18/2013 500.00 0.00 MOB PHONE PAYMENT Sincerely,
NathanT Dhital
Sr. Database DBA
Commbank-Internet
HQ
From: oracle-l-bounce_at_freelists.org [mailto:oracle-l-bounce_at_freelists.org] On Behalf Of David Fitzjarrell Sent: Tuesday, December 03, 2013 3:46 PM To: Niall Litchfield; Oracle- L Freelists Subject: Re: All Apress e-books $15 today
It's not easy writing a book, trust me. I wrote Chapters 1-12 and 14, and Mary wrote Chapter 13 (she has much more ERP experience than I do at the moment).
David Fitzjarrell
On Tuesday, December 3, 2013 2:29 AM, Niall Litchfield <niall.litchfield_at_gmail.com<mailto:niall.litchfield_at_gmail.com>> wrote: I can relate to that sentiment!
On Mon, Dec 2, 2013 at 6:07 PM, David Fitzjarrell <oratune_at_yahoo.com<mailto:oratune_at_yahoo.com>> wrote: Thank you for purchasing my book, "Oracle Exadata Survival Guide". I now know at least ONE copy has sold. :)
David Fitzjarrell
On Monday, December 2, 2013 10:35 AM, max scalf <oracle.blog3_at_gmail.com<mailto:oracle.blog3_at_gmail.com>> wrote:
Question with regards to pro SQL (2nd edition), I do have the first
edition and I love it. How much difference there is between 1st and
2nd? Is there anything new in 2nd edition?
From: Radoulov, Dimitre
Sent: 12/2/2013 10:57 AM
To: oracle.blog3_at_gmail.com<mailto:oracle.blog3_at_gmail.com>; Rich Jesse; oracle-l_at_freelists.org<mailto:oracle-l_at_freelists.org>
Subject: Re: All Apress e-books $15 today
On 02/12/2013 17:39, max scalf wrote:
> I know its only 15 bucks(and I can get couple of them) but are there
> any must have books that we shouldn't miss out on.
>
> Any suggestions?
Hi,
it depends on your needs. I bought some books from Apress recently and
_some_ of them
definitely deserve attention (some of the authors contribute to oracle-l):
- Oracle Exadata Survival Guide - still in Alpha, but seems very interesting, reading the first chapters now
- Pro Oracle SQL 2nd Edition - I have no doubts, considering the 1st edition and the authors list
- Expert Oracle RAC 12c - already read, great book!
- Expert Oracle Enterprise Manager 12c - still reading, very good
Regards
Dimitre
-- http://www.freelists.org/webpage/oracle-l -- Niall Litchfield Oracle DBA http://www.orawin.info/ -- http://www.freelists.org/webpage/oracle-lReceived on Wed Dec 04 2013 - 20:01:29 CET