sql - Changing to join instead of sub query -


    select          a.id, min(s.datetime),          max(s.datetime),          min(s.id)    asdt    inner join alm al on id = al.id,    sta s             a.id not in (select id alm distance <= a.radius )         group a.id 

this query runs slow due subquery when checking distance against a.radius upper table.


Comments

Popular posts from this blog

string - Using python and postgres, variables within execute function? -

python - Creating a new column in a dataframe based on the result of the addition of three others -