Hey Friends,
Feeling a bit rusty here and looking for suggestions on how to tackle this logic.
I have a table with the following columns (item_01 - item_25):
| RecordID | item_01_lat | item_01_lon | item_01_name | item_01_type | item_02_lat | item_02_lon | item_02_name | item_02_type | item_02_other |
My intent is to create the following (removing the unnecessary x,y columns and creating points via [ST_CreatePoint(x,y)]:
| RecordID | item_01_pt | item_01_name | item_01_type | item_02_pt | item_02_name | item_02_type | item_02_other |
The consistent table schema includes column names item_xx_lat and item_xx_lon (where x = 01 to 25). I believe the best approach would be to create an iterative macro but not quite sure how to account for the changing column names and inconsistent column counts for each item_xx_.
Thank you in advance as I knock the dust off...