oki j'ai récrit ma requête de cette manière, ça à l'air plus propre
select
case when gg.c_good_status=3 then 'Suspendu'
when gg.c_good_status=2 then 'Actif'
when gg.c_good_status=5 then 'Historié'
else 'Inderterminé' end as Status,
gg.goo_major_reference,
gg.goo_secondary_reference,
gg.dic_good_family_id,
gg.dic_good_line_id,
case when sp.spo_stock_quantity is not null then sp.spo_stock_quantity
else 0 end as QTY
from gco_good gg
left outer join stm_stock_position sp on gg.gco_good_id=sp.gco_good_id
order by gg.c_good_status,gg.dic_good_line_id,gg.dic_good_family_id,gg.goo_major_reference
Message édité par bossamiral2 le 04-03-2016 à 15:13:55