June 3, 2010 at 7:30 am
Hi All. Can any one help me for this requirement:
I have the Query:
select [Measures].[Revision Number] on 0,
[Dim Product].[Color].[Color].members on 1
from [Adventure Works DW]
The Result is:
Revision Number
Black9843
Blue3970
Grey(null)
Multi3926
NA28919
Red4949
Silver3424
Silver/Black(null)
White568
Yellow4799
Now I want to remove the members that name starting with 'B' and 'S". i.e. I want to remove the members Black,Blue, Silver & Silver/Black from the result.
Thanks in advance...
June 3, 2010 at 9:41 am
Hope this helps:
CREATE TABLE #Dw(Color VARCHAR(20),[Revision Number] INT)
INSERT INTO #Dw
SELECT 'Black', 9843 UNION ALL
SELECT 'Blue', 3970 UNION ALL
SELECT 'Grey', (null) UNION ALL
SELECT 'Multi', 3926 UNION ALL
SELECT 'NA', 28919 UNION ALL
SELECT 'Red', 4949 UNION ALL
SELECT 'Silver', 3424 UNION ALL
SELECT 'Silver/Black', (null) UNION ALL
SELECT 'White', 568 UNION ALL
SELECT 'Yellow', 4799
SELECT Color,[Revision Number] FROM #Dw WHERE Color NOT LIKE 'b%' AND Color NOT LIKE 's%'
/*Results:
ColorRevision Number
GreyNULL
Multi3926
NA28919
Red4949
White568
Yellow4799 */
Viewing 2 posts - 1 through 1 (of 1 total)
You must be logged in to reply to this topic. Login to reply