Skip to content

Instantly share code, notes, and snippets.

@beabetterdevv
Created April 4, 2023 23:29
Show Gist options
  • Save beabetterdevv/2c8e5f89cd812b06929d7306a750c01b to your computer and use it in GitHub Desktop.
Save beabetterdevv/2c8e5f89cd812b06929d7306a750c01b to your computer and use it in GitHub Desktop.
SELECT
Item.OrderId.S as OrderId,
Item.CustomerId.S as CustomerId,
Item.OrderDate.S as OrderDate,
Item.State.S as State,
Item.TotalAmount.N as TotalAmount,
Item.CancelledReasons.L as CancelledReasons,
Item.CancellationMetadata.M as CancellationMetadata
FROM data;
SELECT
Item.OrderId.S as OrderId,
Item.CustomerId.S as CustomerId,
Item.OrderDate.S as OrderDate,
Item.State.S as State,
Item.TotalAmount.N as TotalAmount,
Item.CancelledReasons.L as CancelledReasons,
Item.CancellationMetadata.M as CancellationMetadata
FROM data
WHERE Item.CustomerId.S = 'CID-100'
SELECT
Item.OrderId.S as OrderId,
Item.CustomerId.S as CustomerId,
Item.OrderDate.S as OrderDate,
Item.State.S as State,
Item.TotalAmount.N as TotalAmount,
Item.CancelledReasons.L as CancelledReasons,
Item.CancellationMetadata.M as CancellationMetadata
FROM data
WHERE Item.CustomerId.S = 'CID-100' AND Item.OrderId.S = '5'
SELECT Item.CancellationMetadata.M.canceldate.S as CancelData from data;
SELECT transform(Item.CancelledReasons.L, i -> i.S) AS CancelledReasons FROM data
WHERE (
contains(transform(Item.CancelledReasons.L, i -> i.S), 'ITEM_DAMAGED')
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment