Wednesday, March 28, 2012

Query / function ?

Query/Function Question
I have a retail issue where I store sizes in a table per item. The table
looks like:
PO #
Item #
Color
Size
Size Equiv
What I am trying to do is get a comma delimited list of sizes AND size Equiv
per po/item. The sizes AND Size Equiv need to be a unique list (group by)
excluding color
Example:
PO Item # Size Size Equiv
123 1 2, 4, 6, 8, 10 12, 14, 16, 18, 20
123 2 S, M, L, XL XS, S, M, L
Now the question:
I need to create a SQL query that builds the about list? Is there a way to
do a query call or must I use a stored proc curser to loop thru a select
query?
Thanks in advance,
Stewart Rogershttp://www.aspfaq.com/2529
Please post DDL, sample data and desired results.
See http://www.aspfaq.com/5006 for info.
"Datasort" <Datasort@.discussions.microsoft.com> wrote in message
news:1942D589-AD0C-44D9-B285-E6CB7682F208@.microsoft.com...
> Query/Function Question
> I have a retail issue where I store sizes in a table per item. The table
> looks like:
> PO #
> Item #
> Color
> Size
> Size Equiv
> What I am trying to do is get a comma delimited list of sizes AND size
Equiv
> per po/item. The sizes AND Size Equiv need to be a unique list (group by)
> excluding color
> Example:
> PO Item # Size Size Equiv
> 123 1 2, 4, 6, 8, 10 12, 14, 16, 18, 20
> 123 2 S, M, L, XL XS, S, M, L
> Now the question:
> I need to create a SQL query that builds the about list? Is there a way
to
> do a query call or must I use a stored proc curser to loop thru a select
> query?
>
> Thanks in advance,
> Stewart Rogers
>|||See if this helps:
http://groups-beta.google.com/group...
5bf366dd9e73e
AMB
"Datasort" wrote:

> Query/Function Question
> I have a retail issue where I store sizes in a table per item. The table
> looks like:
> PO #
> Item #
> Color
> Size
> Size Equiv
> What I am trying to do is get a comma delimited list of sizes AND size Equ
iv
> per po/item. The sizes AND Size Equiv need to be a unique list (group by)
> excluding color
> Example:
> PO Item # Size Size Equiv
> 123 1 2, 4, 6, 8, 10 12, 14, 16, 18, 20
> 123 2 S, M, L, XL XS, S, M, L
> Now the question:
> I need to create a SQL query that builds the about list? Is there a way t
o
> do a query call or must I use a stored proc curser to loop thru a select
> query?
>
> Thanks in advance,
> Stewart Rogers
>|||If you want to get it done quickly and easily (minimal sql coding)
and don't care about the 'how', check out the RAC utility for S2k.
See the @.concatenate operator and you'll know what I mean:)
RAC and QALite @.
www.rac4sql.net
"Datasort" <Datasort@.discussions.microsoft.com> wrote in message
news:1942D589-AD0C-44D9-B285-E6CB7682F208@.microsoft.com...
> Query/Function Question
> I have a retail issue where I store sizes in a table per item. The table
> looks like:
> PO #
> Item #
> Color
> Size
> Size Equiv
> What I am trying to do is get a comma delimited list of sizes AND size
> Equiv
> per po/item. The sizes AND Size Equiv need to be a unique list (group by)
> excluding color
> Example:
> PO Item # Size Size Equiv
> 123 1 2, 4, 6, 8, 10 12, 14, 16, 18, 20
> 123 2 S, M, L, XL XS, S, M, L
> Now the question:
> I need to create a SQL query that builds the about list? Is there a way
> to
> do a query call or must I use a stored proc curser to loop thru a select
> query?
>
> Thanks in advance,
> Stewart Rogers
>sql

No comments:

Post a Comment