MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

display key's associated columns horizontally

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Database
View previous topic :: View next topic  
Author Message
tcurrier
Intermediate


Joined: 10 Feb 2006
Posts: 188
Topics: 68

PostPosted: Fri Aug 20, 2010 9:56 am    Post subject: display key's associated columns horizontally Reply with quote

Here's what I'm trying to do:

I have columns :


Code:
BASKET          FRUIT                         
--------        -----                         
BASKET#1        APPLE                         
BASKET#1        BANANA                       
BASKET#1        ORANGE                       
                                             
BASKET#2        PINEAPPLE                     
BASKET#2        BANANA                       
BASKET#2        ORANGE                       
                                             
BASKET#3        APPLE                         
BASKET#3        PEACH                         
BASKET#3        BANANA       



How can I do a query :

SELECT BASKET,
FRUIT
WHERE FRUIT = 'BANANA'

and have ALL of the fruits associated with that basket
displayed across the line, not just show the fruit if it's a BANANA ?
i.e. this:

Code:
BASKET#1  APPLE      BANANA   ORANGE   
BASKET#2  PINEAPPLE  BANANA   ORANGE   
BASKET#3  APPLE      PEACH    BANANA   

Not:
BASKET#1 BANANA
BASKET#2 BANANA
BASKET#3 BANANA
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12375
Topics: 75
Location: San Jose

PostPosted: Fri Aug 20, 2010 10:37 am    Post subject: Reply with quote

tcurrier,

What is the max length(column definition) and max occurrence for BASKET and Banana?

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
tcurrier
Intermediate


Joined: 10 Feb 2006
Posts: 188
Topics: 68

PostPosted: Fri Aug 20, 2010 1:04 pm    Post subject: Reply with quote

Kolusu,

Basket is the key field.... So the number of occurrences of 'Basket' would
depend on the number of occurrences of 'Fruit'. 'Basket's maximum field length is 10.

'Fruit' can occur 15 times per 'Basket' ... Its maximum field length is 10 also...

Thanks.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Database All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group