Reputation: 2606
I have table order
with fields sku
, asin
and json field raw
with some json data there like:
{
"user_sku": "123",
"asin": "213213",
}
Is that possible to update order.sku
with data from order.raw.user_sku
in one sql query?
Upvotes: 0
Views: 95
Reputation:
That looks like a simple UPDATE
update "order"
set sku = raw ->> 'user_sku';
The ->>
operator gets the value for the specified key from the JSON value.
Upvotes: 2