kirzecy670

Untitled

Jul 23rd, 2025
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MySQL 1.74 KB | None | 0 0
  1.        WITH (
  2.               extract(visitParamExtractString(sentPayload, 'message'), '"custom_type":"([^"]+)"') AS m_type,
  3.               extract(visitParamExtractString(sentPayload, 'message'), '"subType":"([^"]+)"') AS m_sub_type,
  4.               visitParamExtractString(sentPayload, 'custom_type') AS s_type,
  5.               visitParamExtractString(sentPayload, 'subType') AS s_sub_type
  6.             )
  7.         SELECT dtSent                                                               AS dt,
  8.                tsSent                                                               AS ts,
  9.                status                                                               AS status,
  10.                multiIf(userDeviceOs = 1 AND m_type != '', m_type,
  11.                        userDeviceOs = 2 AND s_type != '', s_type, '')               AS type,
  12.                multiIf(userDeviceOs = 1 AND sentDebug != 'huawei' AND m_sub_type != '', m_sub_type,
  13.                        userDeviceOs = 1 AND sentDebug = 'huawei' AND s_sub_type != '', s_sub_type,
  14.                        userDeviceOs = 2 AND s_sub_type != '', s_sub_type, pushType) AS sub_type,
  15.                title                                                                AS title,
  16.                text                                                                 AS text,
  17.                toUInt64(userId)                                                     AS user_id,
  18.                userUid                                                              AS user_uid,
  19.                userType                                                             AS user_type,
  20.                userDeviceOs                                                         AS user_device_os
  21.         FROM logs.pushes_sent AS ps
  22.            
Advertisement
Add Comment
Please, Sign In to add comment