Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Replace
Message
 
 
À
19/05/2011 15:17:41
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
Versions des environnements
Visual FoxPro:
VFP 9
OS:
Windows XP
Network:
SAMBA Server
Database:
Visual FoxPro
Divers
Thread ID:
01511100
Message ID:
01511173
Vues:
84
This message has been marked as the solution to the initial question of the thread.
Thanks. I forgot about a little problem, that SQL determines the resulting value type based on the first record.

Try
USE IN SELECT('temp')
CREATE CURSOR temp (FLG1 C(10),EMPNO I,VALUE1 I,A1 I,B1 I,C1 I,D1 I)
INSERT INTO temp VALUES ("A",1,10,0,0,0,0)
INSERT INTO temp VALUES ("B",1,20,0,0,0,0)
INSERT INTO temp VALUES ("C",1,30,0,0,0,0)
INSERT INTO temp VALUES ("D",1,40,0,0,0,0)


INSERT INTO temp VALUES ("B",2,3,0,0,0,0)
INSERT INTO temp VALUES ("C",2,5,0,0,0,0)
INSERT INTO temp VALUES ("D",2,7,0,0,0,0)


INSERT INTO temp VALUES ("B",3,3,0,0,0,0)
INSERT INTO temp VALUES ("D",3,7,0,0,0,0)

INSERT INTO temp VALUES ("C",4,3,0,0,0,0)

select min(flg1) as flg1, EmpNo,min(Value1) as Value1,; 
max(iif(flg1='A',Value1,CAST(0 as I))) as A1, ;
max(iif(flg1='B',Value1,CAST(0 as I))) as B1, ;
max(iif(flg1='C',Value1,CAST(0 as I))) as C1, ;
max(iif(flg1='D',Value1,CAST(0 as I))) as D1  from temp GROUP BY EmpNo ORDER BY EmpNo
>thank you for reply
>i try it but if i have 2 values i see only one value other value as *
If it's not broken, fix it until it is.


My Blog
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform