Re: Examples of real usage of outer joins?
- From: "dimov.vlatko@xxxxxxxxx" <dimov.vlatko@xxxxxxxxx>
- Date: Fri, 17 Aug 2007 14:44:54 -0000
On Aug 4, 11:07 pm, Lew <l...@xxxxxxxxxxxxxxxx> wrote:
david.karr wrote:
This is more of a general database question, not specific to Java, but
can someone describe an actual realistic use of outer joins? I'm
familiar with how it works, and some trivial examples, but I'm frankly
unsure of why you'd actually need to use it.
Example:
You want a list of all customers and their outstanding orders, but they might
not have any orders at the moment:
SELECT c.name, o.ordernum, o.total
FROM customers c LEFT OUTER JOIN orders o
ON c.name = o.cust_name
ORDER BY c.name, o.ordernum;
You don't want to omit a customer from the report just because they haven't
ordered something today.
--
Lew
I wonder if there is anyway simpler and faster than the above that Lew
has explained
Regards
.
- References:
- Examples of real usage of outer joins?
- From: david.karr
- Re: Examples of real usage of outer joins?
- From: Lew
- Examples of real usage of outer joins?
- Prev by Date: Re: Apache Derby performance disappointing
- Next by Date: Re: Examples of real usage of outer joins?
- Previous by thread: Re: Examples of real usage of outer joins?
- Next by thread: Re: Examples of real usage of outer joins?
- Index(es):
Relevant Pages
|
|