home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!cs.utexas.edu!qt.cs.utexas.edu!yale.edu!not-for-mail
- From: muench-philip@math.yale.edu (Philip Muench)
- Newsgroups: comp.databases
- Subject: Re: Help with SQL statement
- Date: 23 Jan 1993 10:48:45 -0500
- Organization: Yale University Mathematics Dept., New Haven, CT 06520-2155
- Lines: 29
- Distribution: na
- Message-ID: <1jrpctINNbqk@CANTOR.MATH.YALE.EDU>
- References: <1993Jan22.211051.4867@vpnet.chi.il.us>
- NNTP-Posting-Host: cantor.math.yale.edu
-
- In article <1993Jan22.211051.4867@vpnet.chi.il.us> mike@vpnet.chi.il.us writes:
- >I'm having a problem writing an SQL statement for the following situation
- >(and I'm not sure its really possible)
- >
- >I have 2 tables lets say I have a Customer table and an order table.
- >I want to query the database for all customers and show their orders
- >for the past month. I may have more than 1 order for a customer.
- >
- >The problem is that if I don't have an order for a customer, the join will
- >not find a match and that customer will be left out of the report.
- >
- >I still want to show the customer even if no orders are present.
- >
- >Is this possible with SQL ?? was my explanation clear enough ??
- >
- >Thanks
- >
- > Mike Kamlet
- > mike@vpnet.chi.il.us
- >
- >
-
- Put a false order that you can easily recognize as false in the order
- table for every customer, or at least for every customer that has no
- real order.
- Joins, as you have found, are useless for finding records in one table
- that do not have a corresponding record in the other table.
- -Philip Muench
- muench@cantor.math.yale.edu 128.36.23.26
-