Created
December 14, 2024 23:18
-
-
Save Tux/f9a4555dea76f3ad3794a20ec013c0bd to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| select f.foo, f.bar, b.beatle | |
| from fumble f | |
| left join brox b on b.x = f.x | |
| and b.y = f.y | |
| and b.z = f.z | |
| and b.g = f.g | |
| and b.h = f.h | |
| and b.k = f.k | |
| and b.j = f.j | |
| order by foo, bar; | |
| => | |
| with | |
| fx as ( | |
| select x, y, z, g, h, k, l, foo, bar, | |
| concat_ws (':', x, y, z, g, h, k, l) as kfx | |
| from fumble | |
| ), | |
| bx as ( | |
| select x, y, z, g, h, k, l, beatle, | |
| concat_ws (':', x, y, z, g, h, k, l) as kbx | |
| from brox | |
| ) | |
| select foo, bar, beatle | |
| from fx | |
| left join bx on kbx = kfx | |
| order by foo, bar; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment