Firebird SQL Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsDatabasesFirebird SQL Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old September 27th, 2004, 12:22 AM
asinderman asinderman is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2004
Posts: 1 asinderman User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
left outer joins

I have a two tables in database:
shipping and qa

shipping consist of:
- ship_date (date) key1
- order_no (integer) key2
- producion (varchar)
- good (intger)

qa consist of:
- ship_date (date) key1 foregin for shipping.ship_date
- order_no (integer) key2 foregin for shipping.order_no
- error (varchar)
- production (varchar)
- qty (integer)

ship_date/order_no/production/good
02.01.2003/1/car/12
02.01.2003/2/car/10
03.01.2003/3/car/5

ship_date/order_no/production/error/qty
02.01.2003/1/car/F01/1
02.01.2003/1/car/F02/1
03.01.2003/3/car/F01/2


I want display all records in order_no and good columns
from shipping table (for specific producion = car) and order_no and qty from qa (for specific error code = F01).

My sql code (which return wrong results):
SELECT s.order_no, s.good, q.order_no, q.qty
FROM SHIPPING s left outer join QA q
on s.ship_date=q.ship_date
where s.production = 'car' and q.error = 'F01'

Result is:
order_no/good/order_no/qty
1/12/1/1
3/5/3/2

I don't know how to receive in result columns also order no 2 with null values for order_no and qty from qa table.

Can someone show me where I make mistake in my sql code?

Br
AR [/FONT] [/SIZE]

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesFirebird SQL Development > left outer joins


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway