daily pastebin goal


a guest Jan 18th, 2019 53 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. select p.peak_id, pp.peak_id
  2. from api.peak as p
  3. join lateral (
  4.     SELECT DISTINCT p2.*
  5.         FROM api.peak as p2, api.peak_to_peak as p2p
  6.         WHERE (p2p.peak_a_id = p2.peak_id OR p2p.peak_b_id = p2.peak_id) AND (p2p.peak_a_id = p.peak_id OR p2p.peak_b_id = p.peak_id) and p2.peak_id != p.peak_id
  7. ) as pp on true
  8. where p.peak_id = 2
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand