When you SELECT a column FROM a table, the column value(s) are made available to functions, either per row, or as aggregates. Function results can be passed consecutively into enclosing functions.
In this case you would simply
SELECT ST_AsText(ST_Segmentize(geom::GEOGRAPHY, 50)) AS geom
Note that I use a cast (::) to GEOGRAPHY; ...
From the answers in the comments:
1. In order to concatenate unique values with group by clause: group_concat(distinct Locality)
2. Data ordering (by the data sample link from comment): From your data, it looks like that the start/End chainage fields are connected with the direction & order so this looks the most promising sql (see image): ...
You get an entry for each voter because you are grouping on the voter column as well, which results in groups that are all single rows. And you cannot include voter_name in the query unless you either aggregate on the column or build groups that include the column, which means that you have to add one more query level to achieve your objective.
Here are a ...
Let's assume there is a layer called "line" (blue), see image below.
So, the vital thing, there must be a distinction between Centroid and Midpoint. There several articles available online, for instance, I personally would consider this one Mathematics: What is the difference between midpoint, center and centroid?.
My personal distinction in terms of the ...
If you're asking about Esri geodatabases, arcpy.ListFeatureClasses does exactly this given an input workspace (e.g. geodatabase connection).
The code (Python 3) from their example:
arcpy.env.workspace = "c:/base/gdb.gdb"
datasets = arcpy.ListDatasets(feature_type='feature')
datasets = [''] + datasets if datasets is not None else 
You need to remove the double quotes in the file. Either don't create them in the text file in the first place (better) or otherwise delete them from the variable when reading it back in using replace():
expr = open('./Output.txt').readline().replace('"', '')
Ie, your expr in/from the file should be:
Project IN ('C1335', 'C1410', 'C1237')
The -spat parameter in ogr2ogr https://gdal.org/programs/ogr2ogr.html#ogr2ogr affects all available layers. This selects data withing the given rectangle from all layers if you write only the name of the datasource into the command but not the layername. So just "...input.gpkg" instead of "...input.gpkg selected_layer".
ogr2ogr -f gpkg -spat 100000 6000000 ...