SHARE
TWEET

Untitled

a guest Mar 15th, 2019 81 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. page_id | page_url
  2. --------------------  
  3.   1     |  a.com
  4.   2     |  b.com
  5.   3     |  c.com
  6.   4     |  d.com
  7.    
  8. hyperlink_id | source_id | destination_id
  9. 1            | 1         | 2
  10. 2            | 1         | 3
  11. 3            | 2         | 4
  12. 4            | 4         | 4
  13.    
  14. SELECT Page.page_url, Page.page_url from Hyperlink
  15. JOIN Page
  16. ON Page.page_id = Hyperlink.source_id
  17. AND Page.page_id = Hyperlink.destination_id
  18. where Hyperlink.hyperlink_id = 1
  19.    
  20. SELECT Page.page_url, Page.page_url
  21.   FROM Hyperlink
  22.   JOIN Page
  23.     ON Page.page_id = Hyperlink.source_id
  24.    AND Hyperlink.source_id = Hyperlink.destination_id
  25.  WHERE Hyperlink.hyperlink_id = 1
  26.    
  27. SELECT p1.page_url, p2.page_url
  28.   FROM Hyperlink
  29.   JOIN Page p1
  30.     ON p1.page_id = Hyperlink.source_id
  31.   JOIN Page p2
  32.    AND p2.page_id = Hyperlink.destination_id
  33.  WHERE Hyperlink.hyperlink_id = 1
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
 
Top