Another interesting problem:
If have a table containing text entries with a category and a position number, like this:
[intPosition] [intCategory] [intText]
1 CAT1 Text1
2 CAT1 Text2
3 CAT1 Text3
4 CAT2 Text4
5 CAT2 Text5
6 CAT2 Text6
7 CAT3 Text7
... and so on....
Now I want to provide a form that lists all categories (DISTINCT ROW) and allows the user with an arrow up/down button to move (switch) the categories in their order. Which means the whole bunch of entries that belong to that category must be switched.
I fail in displaying these categories (I don't need to show the text-entries at this point). SELECT DISTINCT ROW [strCategory] ..... gets me all the categories, but I'm missing the [intPosition] field. But when I include the [intPosition] of course DISTINCT ROW doesnt apply to [strCategory] only any more.... Is this solveable in SQL?
If have a table containing text entries with a category and a position number, like this:
[intPosition] [intCategory] [intText]
1 CAT1 Text1
2 CAT1 Text2
3 CAT1 Text3
4 CAT2 Text4
5 CAT2 Text5
6 CAT2 Text6
7 CAT3 Text7
... and so on....
Now I want to provide a form that lists all categories (DISTINCT ROW) and allows the user with an arrow up/down button to move (switch) the categories in their order. Which means the whole bunch of entries that belong to that category must be switched.
I fail in displaying these categories (I don't need to show the text-entries at this point). SELECT DISTINCT ROW [strCategory] ..... gets me all the categories, but I'm missing the [intPosition] field. But when I include the [intPosition] of course DISTINCT ROW doesnt apply to [strCategory] only any more.... Is this solveable in SQL?