I've created start and end points from a LineString layer using this answer from another question:
select id, sts as route_id, st_endpoint(geometry) as geometry from pointclasstest
union
select id, sts as route_id, st_startpoint(geometry) as geometry from pointclasstest
According to the comments to that post, using union is the only option to show both start and endpoints at the same time.
Now I am looking for a way to still seperate start and end points from each other within the layer via an added attribute, e. g. start=1, end=2
Is there a possibility to create a new field via SQL query when creating the layer and writing a given value into it?
I've read into adding columns via SQL, but they all refer to an already existing table (ALTER TABLE, ADD, etc.)