-
Notifications
You must be signed in to change notification settings - Fork 0
WITH
Alex edited this page Jul 29, 2018
·
1 revision
Possible structures:
-
Array
- with values:
- name
- sub querry
- nested
- with values:
-
Hash
- keyword - name
- value - sub querry
with: [:alias_name, { select: true, from: :users}]
with: [[:alias_name, { select: true, from: :users}],
[:alias_name_2, { select: {u: [:name, :email]},
from: :rgl}]]
# => 'WITH alias_name (SELECT * FROM users ), alias_name_2 (...) '
# OR
with name: { select: true },
another_name: { select: :mrgl }
# => 'WITH name AS (SELECT * ), another_name AS (SELECT mrgl ) '