daily pastebin goal
7%
SHARE
TWEET

Untitled

a guest Jan 21st, 2019 60 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. join on    
  2.   CASE FIELD1    
  3.    When 1 THEN FIELD 2 = FIELD3    
  4.    When 2 THEN FIELD 4 = FIELD5    
  5.   END
  6.    
  7. .... join on  (field1=1 AND field2=field3) OR (field1=2 AND field4=field5)
  8.    
  9. select ...
  10. from ...
  11. join ...
  12.    on  (field1=1 AND field2=field3)
  13. union
  14. select ...
  15. from ...
  16. join ...
  17.    on  (field1=2 AND field4=field5)
  18.    
  19. select * from table as x where x.field1 = 1 AND x.field2 = x.field3
  20. union [ALL]
  21. select * from table as y where x.field1 = 2 AND y.field4 = y.field5
  22.    
  23. from A left outer join
  24.      B b1
  25.      on a.field2 = b2.field3 left outer join
  26.      B b2
  27.      on a.field4 = b2.field5
  28.    
  29. SELECT *
  30. FROM data_parent
  31. WHERE pid =
  32. CASE
  33. WHEN pid =1
  34. THEN (
  35. SELECT id
  36. FROM data_parent, test
  37. WHERE data_parent.pid = test.id
  38. )
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