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.
postgresql timestamp
How i can get the difference of closest two date in two table join in postgresql
test
PostreSQL: Subquery
SQL - Social Network Analysis by Patrick Lin
Return IDs where there are exactly 3 occurrences
pokemo
1075-1077 Project Analysis
Q3
histogram to percentiles
Please log in to post a comment.