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 52 53 54 55 56 57 58 59 60 61 62 63 64 65
| sql = """SELECT DISTINCT
commande_client.CODE_ART_COM AS 'code_article',
commande_client.CODE_COLM AS 'code_couleur',
ART_COM.CODE_TAIL AS 'code_taille',
commande_client.QTE_T1 AS 'qt1',
commande_client.QTE_T2 AS 'qt2',
commande_client.QTE_T3 AS 'qt3',
commande_client.QTE_T4 AS 'qt4',
commande_client.QTE_T5 AS 'qt5',
commande_client.QTE_T6 AS 'qt6',
commande_client.QTE_T7 AS 'qt7',
commande_client.QTE_T8 AS 'qt8',
commande_client.QTE_T9 AS 'qt9',
commande_client.QTE_T10 AS 'qt10',
commande_client.QTE_T11 AS 'qt11',
commande_client.QTE_T12 AS 'qt12',
GLN.GENC_T1 AS 'gencod_t1',
GLN.GENC_T2 AS 'gencod_t2',
GLN.GENC_T3 AS 'gencod_t3',
GLN.GENC_T4 AS 'gencod_t4',
GLN.GENC_T5 AS 'gencod_t5',
GLN.GENC_T6 AS 'gencod_t6',
GLN.GENC_T7 AS 'gencod_t7',
GLN.GENC_T8 AS 'gencod_t8',
GLN.GENC_T9 AS 'gencod_t9',
GLN.GENC_T10 AS 'gencod_t10',
GLN.GENC_T11 AS 'gencod_t11',
GLN.GENC_T12 AS 'gencod_t12'
FROM commande_client
INNER JOIN GLN_tail ON GLN_tail.CODE_ART_COM = commande_client.CODE_ART_COM
INNER JOIN GLN ON (GLN.CODE_ART_COM = commande_client.CODE_ART_COM AND GLN.CODE_COLM = commande_client.CODE_COLM)
INNER JOIN ART_COM ON ART_COM.CODE_ART_COM = commande_client.CODE_ART_COM
WHERE commande_client.NUM_CDE = :numcommande
group by
commande_client.CODE_ART_COM,
commande_client.CODE_COLM,
ART_COM.CODE_TAIL,
commande_client.QTE_T1,
commande_client.QTE_T2 ,
commande_client.QTE_T3 ,
commande_client.QTE_T4 ,
commande_client.QTE_T5 ,
commande_client.QTE_T6 ,
commande_client.QTE_T7 ,
commande_client.QTE_T8 ,
commande_client.QTE_T9 ,
commande_client.QTE_T10 ,
commande_client.QTE_T11 ,
commande_client.QTE_T12 ,
GLN.GENC_T1,
GLN.GENC_T2,
GLN.GENC_T3,
GLN.GENC_T4,
GLN.GENC_T5,
GLN.GENC_T6,
GLN.GENC_T7,
GLN.GENC_T8,
GLN.GENC_T9,
GLN.GENC_T10,
GLN.GENC_T11,
GLN.GENC_T12
ORDER BY
'code_article',
'code_couleur'
""" |
Partager