phoenix-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Vaghawan Ojha <>
Subject Upserting in batch into a column of all rows by concatenating multiple columns
Date Sat, 28 Oct 2017 11:25:17 GMT

I want to update a column's value in all rows by concatenating values from
the multiple columns of the rows. In plain sql it's possible to do that but
I'm not sure if that can be done in Phoenix.

For say I've four columns in a table:

(id, product_id, price, store_id, bill_id)

Now I already have the values of id, product_id, price and store_id in the
table. But now I want to set the values of bill_id in all rows to something
like this:

product_id || '-' || store_id

Is it possible? If it is, then how do I do it. I don't know if that can be
done with Atomic upsert.

Any help would be great.


View raw message