Bonjour,

je souhaite rapporter tous les numéros de commande (order_number), même s'ils n'ont pas tous un emplacement (segment1).
Or avec le code suivant, seuls les numéros de commande ayant un emplacement sortent.

Comment faire?

Merci,
Douchka

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
select distinct
ooh.order_number
,ool.ordered_item
--,msn.serial_number
,msn.current_subinventory_code
,mil.segment1
, trunc(ooh.ordered_date) "ordered date"
, trunc(ooL.PROMISE_date) "promise date"
, trunc(ooL.SCHEDULE_SHIP_date) "schedule ship date"
, ooh.flow_status_code
, rac.customer_name
from oe_order_headers_all  ooh
, oe_order_lines_all ool
, ra_site_uses_all    rsu
, ra_addresses_all     raa
, ra_customers     rac
, ra_customer_trx_all rct
, ar_payment_schedules_all aps
, fnd_user fu
, fnd_TERRITORIES_VL RAT
, MTL_SERIAL_NUMBERS msn 
, MTL_ITEM_LOCATIONS mil
where ooh.order_type_id = 3435
and ooh.header_id = ool.header_id
and ooh.ship_to_org_id = rsu.site_use_id
and rsu.address_id = raa.address_id
AND RAA.COUNTRY = RAT.TERRITORY_CODE
and raa.customer_id = rac.customer_id
and rct.org_id(+) = 119
and rct.customer_trx_id = aps.customer_trx_id(+)
and ooh.created_by = fu.user_id
and msn.SERIAL_NUMBER=to_char(ooh.ORDER_NUMBER)
and ooh.flow_status_code='BOOKED'
AND (ool.creation_date) >= TO_DATE ('25/10/2010', 'DD/MM/YYYY')
and msn.CURRENT_LOCATOR_ID=mil.INVENTORY_LOCATION_ID