How to update multiple different values at the same time in one query
How to create a raw SQL to update in Rails different values for each record in one single query
Apr 1, 20223 min read5.4K

Search for a command to run...
Articles tagged with #sql
How to create a raw SQL to update in Rails different values for each record in one single query

Context You have a column in your table that is used as an array , like this: t.string 'ids', array: true And you want to select all records that have more than N elements in the array Solution In PostgreSQL, you can use cardinality to achieve ...