Bonjour,
Je travaille sous Oracle 10g. Je cherche à mettre à jour le prix d'inventaire pour les articles correspondant à "un certain type".
Voici ma requête pour obtenir ce prix:
Je souhaite mettre à jour le champ pu de la table t_article à partir de z.cout_total. L'identifiant est id_article.
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51 select a.id_article, z.cout_total from toppdm.object o inner join (select tmp.id_routing, sum(tmp.cout_pour_un) as cout_total from ((select b1.* from V_TRT_UNIT_BESOIN_ACHAT b1 union select b2.* from V_TRT_UNIT_CDE_BES_ACHAT b2 union select b3.* from V_TRT_UNIT_BES_CDE_ACHAT b3 union select b4.* from V_TRT_UNITTOT_BESOIN_ACHAT b4 union select b5.* from V_TRT_UNITTOT_BESAB1_ACHAT b5 union select b6.* from V_TRT_UNITTOT_BESAB2_ACHAT b6 union select b7.* from V_TRT_UNIT_TOLE_1 b7 union select b8.* from V_TRT_UNIT_TOLE_2 b8 union select b9.* from V_TRT_UNIT_TOLE_3 b9 union select b10.* from V_TRT_UNIT_TOLE_4 b10 union select b11.* from V_TRT_UNIT_TOLE_5 b11 union select b12.* from V_TRT_BES_M_MM b12 union select b20.* from V_TRT_MAT_SANS_LIV b20 ) tmp) group by tmp.id_routing) z on o.id_routing = z.id_routing inner join toperp.t_article a on a.id_object = o.id_object where a.b_prod = -1 and a.id_famille = 385 and a.id_type_article = 1 and o.type = 47
Je ne connais pas la syntaxe à adopter.
Merci d'avance.
Julien.
Partager