|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
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] |
![]() |
| Viewing: Dev Shed Forums > Databases > Firebird SQL Development > left outer joins |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|