Skip to content

Instantly share code, notes, and snippets.

const zuppler = 'c6b348e0-6d49-11ea-9d4d-db9d78913103'
const vendor = '05a3b881-ee42-11eb-a309-21dcd8197474'
const time = moment()
.add({ hours: 2 })
.startOf('hour')
.toISOString()
//quote payload
const q = {
bag_count: 1,
@mikepaszkiewicz
mikepaszkiewicz / gist:b8759fab46b23c3964192047cbd5cac5
Created March 8, 2023 15:51
join users with their latest device by created_at
SELECT
u.*,
row_to_json(d.*) device
FROM
users u
INNER JOIN (
SELECT
user_id,
MAX(created_at) MaxDate
FROM