Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
About CrossTab Query or similar query
Message
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
About CrossTab Query or similar query
Divers
Thread ID:
00804158
Message ID:
00804158
Vues:
68
Hi All,
i have original data like below and its related with textile sector ... i want to sum I/O actions group by orderno,crow,I/O,htyp and show its on the one row group by orderno,crow with SQL how can i do this ?

* crow means colour row number on the original data eg. 1 for L.GRIMEL 2 for D.GRIMEL
* I/O means input-output actions 1 means output 2 means input
* htyp means 1 ok ,2 faulty


type orderno model crow colour IO htyp S M L X L
==== ========== ====== ==== ======== == ==== == === === === ==
1 BDO22HSW01 BD10-1 1 L.GRIMEL 1 1 58 116 116 58 58
1 BDO22HSW01 BD10-1 1 L.GRIMEL 1 1 57 114 114 57 57
1 BDO22HSW01 BD10-1 1 L.GRIMEL 2 2 15 0 0 0 0
1 BDO22HSW01 BD10-1 1 L.GRIMEL 2 1 41 114 114 57 57
1 BDO22HSW01 BD10-1 1 L.GRIMEL 2 2 34 0 0 0 0
1 BDO22HSW01 BD10-1 1 L.GRIMEL 2 1 24 116 116 58 58

1 BDO22HSW01 BD10-1 2 D.GRIMEL 1 1 58 116 116 58 58
1 BDO22HSW01 BD10-1 2 D.GRIMEL 1 1 57 114 114 57 57
1 BDO22HSW01 BD10-1 2 D.GRIMEL 2 2 15 0 0 0 0
1 BDO22HSW01 BD10-1 2 D.GRIMEL 2 1 42 114 114 57 57
1 BDO22HSW01 BD10-1 2 D.GRIMEL 2 2 34 0 0 0 0
1 BDO22HSW01 BD10-1 2 D.GRIMEL 2 1 24 116 116 58 58

finally data should be view like below

type orderno model crow colour IO htyp S M L X L
==== ========== ====== ==== ======== == ==== === === === === ===
1 BDO22HSW01 BD10-1 1 L.GRIMEL 1 1 115 230 230 115 115
1 BDO22HSW01 BD10-1 1 L.GRIMEL 2 1 65 230 230 115 115
1 BDO22HSW01 BD10-1 1 L.GRIMEL 2 2 49 0 0 0 0
1 BDO22HSW01 BD10-1 2 D.GRIMEL 1 1 115 230 230 115 115
1 BDO22HSW01 BD10-1 2 D.GRIMEL 2 1 66 230 230 115 115
1 BDO22HSW01 BD10-1 2 D.GRIMEL 2 2 49 0 0 0 0

also wantto calculate the I/O differences and show only differences > 0 like below

for eg. S size L.GRIMEL output 115 input 65+49=114 115-114 = 1


TIA
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform