Information générale
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
Précédent
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement