| Welcome to WebmasterWorld Guest from 126.96.36.199 |
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
|Pubcon Platinum Sponsor 2014|
|Help with MS SQL query|
I'm a bit stumped and hope someone can help. I have this table:
CAT STY COL SIZ
NEW F21 RED SML
NEW F21 RED LRG
NEW F21 BLK SML
NEW F21 BLK LRG
NEW F44 RED SML
NEW F44 RED LRG
NEW F44 GRN SML
On a previous page the CAT has already been picked...what I want to show on a page (assuming CAT=NEW):
CAT=NEW, STY=F21, COL=RED, BLK
CAT=NEW, STY=F44, COL=RED, GRN
Size does not need to display on this page but lines are differentiated by their size, as shown in the table example.
So basically given the cat, for each distinct style I want to show all available colors.
how do I construct a query that does this?
Thanks for any help you can offer!
Unless I'm misreading something, the following should work:
SELECT DISTINCT STY, COL
How you output that depends on the language you're using for your front end development.
OK, I will give that a try, thanks!
That worked...sometimes you just try to make it too hard. :-) Thanks!
All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved