General information
Category:
Databases,Tables, Views, Indexing and SQL syntax
Try this:
select dist name, box,media from (table) into curs tmpcurs1 nofilt
select name, cnt(*) ,media from tmpcurs1 group by 1,3
>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
Previous
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only