Hey folks,
I need a little help with a SQL query. I am looking to get a range but trying to limit to the first 4 numbers of a code. The table looks like this:
Table Categories:
Cat_ID-----Code----Title
1------------4111------Beverages
2------------41111----CocaCola
3------------41112----Pepsi Cola
4------------41113----Dr. Pepper
5------------4112-----Snacks
6------------41121----Potatoe Chips
7------------41122----Cheese Curls
8------------4113------Sandwhiches
9------------41131----Grilled Cheese
10----------41132-----Cheese Burger
What I need to do is pull the primary categories like beverages(4111), Snacks(4112), and Sandwhiches(4113). I need to do this without pulling the subcategories like cocacola, pepsi etc.
I have tried Like '411%' but that pulls all categories, my question is there a way to to pull just the 4 digit codes that are like 411?
Thank you in advance for your help.