Run Code
|
API
|
Code Wall
|
Users
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
statistics
drop table if exists my_table; create table my_table(id serial primary key, event_id integer, answers jsonb); insert into my_table (event_id, answers) values (10, '{"colores": ["Rojo", "Verde", "Azul"]}'::jsonb), (10, '{"colores": ["Amarillo", "Verde"]}'), (10, '{"colores": ["Azul"]}'), (10, '{"maderas": ["pino"]}'); SELECT jsonb_array_elements_text(answers->'colores') AS colores, count(id) FROM my_table WHERE event_id = 10 GROUP BY colores;
run
|
edit
|
history
|
help
0
Please
log in
to post a comment.
1097. Game Play Analysis V
Postgres CrossTab for query with variable number of columns
Movie Rating SQL Analysis Project
Movie Rating SQL Analysis Project
generate-data-combinations-for-a-column-dynamically-based-on-another-column-sql-postgresql
Dashes in numbers
E-commerce Website SQL Analysis
Pivot the Hard Way.
Leetcode 571 Find Median Given Frequency of Numbers & 614 Second Degree Follower
Krug_test
Please log in to post a comment.