Mon Jul 15 2019
Json field queries
SELECT
*, `payload`->"$[0].eCommerceOrderId" AS `e_commerce_order_id`
FROM
pendingOrderStatus
WHERE
`status` = 'sent';
SELECT
id, `order`->>'$.e_commerce_order_id' AS `e_commerce_order_id`
FROM
order_log_transforms
WHERE
`order`->>'$.e_commerce_order_id' IS NOT NULL;
Wed Jul 17 2019
Importing from the source table in one database to the destination in another database.
INSERT INTO `materials-staging`.`files` (`id`, `path`, `type`, `hash`, `material_id`, `active`, `created_at`, `updated_at`, `deleted_at`)
SELECT
*
FROM
`materials_staging`.`mat_files`;