I have an SQL table that contains a list of categories. Each item starts with a number (the main category number), or a number "dot" another number (main category number and its subcategory number).
For example
10 Main Category A------
10.10 Sub Category A1
10.20 Sub Category A2
20 Main Category B
20.10 Sub Category B1
...
First I need only all entries that have main category numbers, in another query I have to filter only for subitems, that starts with e.g. 10 and give back all entries 10.10 and 10.20
The program I'm making needs to first select the Main category and based on the selected main category select the subcategories. There is no link in database between entries (parent-child) and only a sorting id e.g.
[0-9][0-9]
I know, but then how to check for a possible (but not present third digit) and then NO following dot.