I'm having a bit of trouble with the Alias variable in MapBasic. In short, I have a table where I was to group by a specific column. Then I want to run through each unique value from the grouped table through the original one and combine each one. So I have a table of cities with a column of which country each city is in. My program gives the user to choose a table and a column within that table to gorup by. Then it basically goes like this:
Dim aSelection, aGrouped as Alias Selection = selectedTable & "." & selectedColumn Select * from selectedTable into Temp_GroupedTable Group By selectedColumn aGrouped = Temp_GroupedTable & "." & selectedColumn
So a) is this code correct? b) How can I fetch the data from each row in the Temp_GroupedTable so that I can compare it with the values in the original table? I currently have this general setup within a loop:
Fetch rec i from Temp_GroupedTable Select * from selectedTable into New_Temp_TAB Where aSelection = aGrouped Objects Combine
I know there is something wrong... But I don't know how to fix it. Any ideas?