SHARE
TWEET

Untitled




Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
- select p.peak_id, pp.peak_id
- from api.peak as p
- join lateral (
- SELECT DISTINCT p2.*
- FROM api.peak as p2, api.peak_to_peak as p2p
- 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
- ) as pp on true
- 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.