I have some trip data and I want to draw a line between the start and end coordinates.
I have two layers in CartoDB - one contains the start coordinates (with trip_id & cartodb_id). The other contains the corresponding end coordinates (with trip_id & cartodb_id).
As I'm new to CartoDB/SQL in general, how can I join these the two coordinates for the same trip?
I found this code somewhere but it hasn't been working for me thus far:
SELECT
ST_MakeLine(
the_geom_webmercator,
(SELECT
the_geom_webmercator
FROM
hubway_july2012_end
WHERE trip_id = cartodb_id LIMIT 1
)
) AS the_geom_webmercator
FROM
hubway_july2012_start
AS c
(I've edited it a little bit, but I'm not sure if what I have done is right).