Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
What is best structure for detail files ?
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00495606
Message ID:
00495844
Vues:
11
Ok Alex, consider this then,

select transid, iif(incometype =1, amount,0) as incometype1amt, iif(incometype
=2, amount,0) as incometype2amt from yourtable order by transid group by transid


>Thanks Alek, but that is not exactly what I am looking for.
>
>I am looking for an SQL way to create a cursor with a column for each type of income. Each transaction would result in a single record with values in the appropriate columns and zeroes in others.
>
>Alex
>
>>look at the vfp help file for 'select - sql' paying close attention to the 'group by' statement.
>>
>>If I understood you, some similart to the following will be what you will need to use, of course I don't know your field or alias names.
>>
>>
>>select transid, incometype, amount from yourtable order by transid, incometype group by transid, incometype
>>
>>
>>hope this helps
>>Alek
Alek Massey
- The only stupid question is one left unasked -
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform