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
The current examples for JSONB (yum and apt) are outside the domain of the DVD rental example. It might be more beneficial to add JSONB columns to either the existing view or to create a new (materialized) view that has these json columns. An example below.
-- actor_info viewSELECTa.actor_id,
a.first_name,
a.last_name,
jsonb_object_agg(c.name, (SELECT array_agg(f.title) AS array_agg
FROM film f
JOIN film_category fc_1 ONf.film_id=fc_1.film_idJOIN film_actor fa_1 ONf.film_id=fa_1.film_idWHEREfc_1.category_id=c.category_idANDfa_1.actor_id=a.actor_idGROUP BYfa_1.actor_id)) AS film_info
FROM actor a
LEFT JOIN film_actor fa ONa.actor_id=fa.actor_idLEFT JOIN film_category fc ONfa.film_id=fc.film_idLEFT JOIN category c ONfc.category_id=c.category_idGROUP BYa.actor_id, a.first_name, a.last_name;
This would enable users to get more familiar with different jsonb operator when filtering on the view. For instance this simple example below
SELECT actor_id, first_name, last_name, film_info
FROM actor_info
WHERE film_info ->'Games' ? 'FEATHERS METAL'
The text was updated successfully, but these errors were encountered:
The current examples for JSONB (
yum
andapt
) are outside the domain of the DVD rental example. It might be more beneficial to add JSONB columns to either the existing view or to create a new (materialized) view that has these json columns. An example below.This would enable users to get more familiar with different jsonb operator when filtering on the view. For instance this simple example below
The text was updated successfully, but these errors were encountered: