| Welcome to WebmasterWorld Guest from 18.104.22.168 |
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
|Become a Pro Member|
|Help with MS SQL query|
| 7:15 pm on Jun 9, 2010 (gmt 0)|
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!
| 8:59 pm on Jun 9, 2010 (gmt 0)|
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.
| 12:10 pm on Jun 10, 2010 (gmt 0)|
OK, I will give that a try, thanks!
| 5:01 pm on Jun 10, 2010 (gmt 0)|
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