|
|
|
Forum Newbie
      
Group: General Forum Members
Last Login: Thursday, November 15, 2012 10:56 PM
Points: 8,
Visits: 127
|
|
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 Black 9843 Blue 3970 Grey (null) Multi 3926 NA 28919 Red 4949 Silver 3424 Silver/Black (null) White 568 Yellow 4799
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...
|
|
|
|
|
SSCertifiable
       
Group: General Forum Members
Last Login: Today @ 8:06 AM
Points: 5,100,
Visits: 20,193
|
|
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: Color Revision Number Grey NULL Multi 3926 NA 28919 Red 4949 White 568 Yellow 4799 */
If everything seems to be going well, you have obviously overlooked something.
Ron
Please help us, help you -before posting a question please read Before posting a performance problem please read
|
|
|
|