Skip to content

Instantly share code, notes, and snippets.

View emanakin's full-sized avatar

Emmanuel Akinlosotu emanakin

View GitHub Profile
// Non-recursive, depth-limited (3 hops) descendant TXM count by direction.
// Bind params IN THIS ORDER: [direction, masterId, masterId, masterId]
export const SQL_COUNT_DESC_TXM = `
SELECT COUNT(*) AS CNT
FROM (
SELECT t.OBJ_ID
FROM FTM.TRANSMISSION_BASE t
JOIN FTM.CHANNEL c ON c.ID = t.CHANNEL_ID
WHERE c.INBOUND = ?
AND t.OBJ_ID IN (