You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
=> ["SELECT FROM guests CASE WHEN name = ? THEN ? WHEN name = ? THEN ? ELSE ? END"
233
+
"Bob"
234
+
"Mr. B."
235
+
"Alisa"
236
+
"Strange Lady"
237
+
"Unknown"]
238
+
```
239
+
210
240
### except
211
241
212
242
```clojure
@@ -240,6 +270,35 @@ The `ilike` and `not-ilike` operators can be used to query data using a pattern
240
270
0.250.500.75]
241
271
```
242
272
273
+
### join lateral
274
+
275
+
Sometimes we need some pivot functionality to solve some analytical tasks or just improve the performance of our queries. In PostgreSQL we have `JOIN LATERAL` clauses to do that.
=> ["SELECT count(*) AS total_n, count(gr_coef) AS good_n, count(br_coef) AS bad_n, avg(gr_length) AS good_length, avg(gr_coef) AS good_coef FROM stats_open_results r INNER JOIN stats_positions p ON p.id = r.position_id JOIN LATERAL (SELECT (CASE WHEN strength_coef >= 3 THEN best_length END) AS gr_length, (CASE WHEN strength_coef >= 3 THEN strength_coef END) AS gr_coef, (CASE WHEN strength_coef < 3 THEN strength_coef END) AS br_coef) z0 ON true WHERE (p.direction = ?) GROUP BY r.class_id"
297
+
"UP"]
298
+
```
299
+
- left-join-lateral
300
+
The same functionality but for the case when the existing of a pivot result for each row is not mandatory.
301
+
243
302
### SQL functions
244
303
245
304
The following are the SQL functions added in `honeysql-postgres`
0 commit comments