Skip to content
Snippets Groups Projects
QueryComplexAirportIdiomatic.R 372 B
Newer Older
Julien Lopez's avatar
Julien Lopez committed
max_duration = 480L

trip = new.tableRef("trip", "PostgreSQL", "postgre.config", "public")

airport = new.tableRef("airport", "PostgreSQL", "postgre.config", "public")

q = subset(merge(query.from(trip), query.from(airport), by.x="depart", by.y="code"),
		   function(e) e$duration > max_duration,
		   c(city, arrival, duration))

results = query.force(q)
print(results)