General information
Forum:
Microsoft SQL Server
Thanks Michael
I prefer beaking the catcode too.
Gerardo
>Gerardo,
>
>Would something like this work for you?
>
>SELECT CatCategory, CatDescription FROM CatTable
>WHERE catcode LIKE '__000'
>
>And if so, you could do away with the CatCategory column by taking the first two characters of catcode:
>
>SELECT LEFT(catcode, 2) AS Category, CatDescription
>FROM cattable
>WHERE catcode LIKE '__000'
>
>The downside is that the queries are sensitive to the business rules that are used to construct catcode. In general, I would perfer breaking the catcode into a two columns like primary_cat and secondary_cat or something like that.
>
>-Mike
>
>>CatCod CatDescription CatCategory
>>--------------------------------------------------------
>>01000 Agriculture 01
>>01001 Agriculture - Plants 01
>>01002 Agriculture - Animals 01
>>02000 Automotives 02
>>02001 Automotives - parts 02
>>02002 Automotives - Dealers 02
>>03000 Travel 03
>>03001 Travel - Airplanes 03
Previous
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only