Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Difficult select on non-normalized table
Message
 
À
06/03/2003 14:50:06
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00762391
Message ID:
00762512
Vues:
14
SELECT Name, CNT(*) AS CountMedia FROM Table GROUP BY Name,Media INTO CURSOR MyResult

BTW, Your table looks normalized to me. The only thing missing is a primary key.



>I need help getting information out of a table that is not normalized. I think what I need is a nested select statement but it’s not coming together.
>
>What I have is a table with four fields: name, box, media, title.
>
>Name..Box..Media..Title
>Jane...1....CD.....A
>Jane...1....CD.....B
>Jane...2....CD.....C
>Jane...3....TAPE...A
>Joe....1....CD.....A
>Joe....2....CD.....B
>Joe....3....TAPE...A
>Joe....3....TAPE...B
>Joe....4....TAPE...C
>Joe....4....DISK...A
>
>What I need to know is how many boxes of each media per individual.
>A bonus, which I don’t think is possible, would to some how identify those boxes which have split content. For example: Joe has one box (box 4) that contains both tape and disk.
>
>Jane
>2....CD
>1....Tape
>
>Joe
>2...CD
>2...TAPE
>1...Disk
>
>Any help would be appreciated.
>TIA
>Peter
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform