i've been doing research find way concatenate fields multiple rows single row in result set. objective create list of alternate sizes base product number, excluding each row naming alternate size.
i've done using xml path method, have catch 22.
first, query produces rows null values concatenation results when no product records containing alternates sizes found. have not found way eliminate these null result rows.
second: no problem, thought i. i'll create view query, take view off of eliminates rows null results. however, sql view rejects xml element works fine query.
here query:
select prod2.partnumber, substring( ( select ','+prod1.partnumber [text()] items prod1 left(prod1.partnumber,8) = left(prod2.partnumber,8) , prod1.partnumber <> prod2.partnumber order prod1.partnumber xml path ('') ), 2,1000) altsizes items prod2 so i'd love way eliminate null "altsizes". i've tried altsizes not null, results in error telling me altsizes not valid field.
thanks in advance getting rid of null results!
Comments
Post a Comment