Guest User

Untitled

a guest
Jun 21st, 2018
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. SELECT *
  2. FROM
  3. (SELECT a.a AS a, a.b AS b, d.c AS c FROM table_a a JOIN table_d d on d.a = a.a),
  4. (SELECT c.a AS a, c.b AS b, d.c AS c FROM table_c c JOIN table_d d on d.a = ca.a),
  5. (SELECT b.a AS a, b.b AS b, d.c AS c FROM table_b b JOIN table_d d on d.a = b.a)
  6.  
  7. Union results in ambiguous schema [d.c] is ambiguous and is aliasing multiple fields
  8.  
  9. select *
  10. from
  11. (select a, b
  12. from table_a, table_b, table_c) as a
  13. join
  14. (select a, c
  15. from table_d) as d
  16. on a.a = d.a
Add Comment
Please, Sign In to add comment