squirrel icon indicating copy to clipboard operation
squirrel copied to clipboard

UPDATE with FROM statement

Open bohrasankalp opened this issue 4 years ago • 2 comments

Any example where from could be used with update query.

update albums
set num = jsonb_set(num, '{folders}', to_jsonb(coalesce(sq.counts, 0)), false)
from (select s.album_id, COUNT(s.album_id) as counts
			from file_system s
			where is_dir = true
			group by s.album_id
			order by s.album_id) as sq
where albums.id = sq.album_id;

bohrasankalp avatar Jul 10 '21 16:07 bohrasankalp

has there been any update on this?

officialgupta avatar Nov 16 '21 16:11 officialgupta

has there been any update on this?

I don't think so, I have the same question.

ysomad avatar Mar 23 '22 07:03 ysomad