Skip to content

Instantly share code, notes, and snippets.

@rwcarlsen
Created July 1, 2014 19:01
Show Gist options
  • Save rwcarlsen/ca17415f3897a71aa414 to your computer and use it in GitHub Desktop.
Save rwcarlsen/ca17415f3897a71aa414 to your computer and use it in GitHub Desktop.
custom cyan queries json file
{
"puseries":
"SELECT ti.Time,SUM(cmp.MassFrac * inv.Quantity) FROM ( Compositions AS cmp INNER JOIN Inventories AS inv ON inv.QualId = cmp.QualId INNER JOIN TimeList AS ti ON (ti.Time >= inv.StartTime AND ti.Time < inv.EndTime)) WHERE ( inv.SimId = cmp.SimId AND ti.SimId = inv.SimId AND cmp.NucId = 942390000) GROUP BY ti.Time,cmp.NucId;",
"agentop":
"SELECT ag.Prototype,SUM(IFNULL(ag.ExitTime,Info.Duration)-ag.EnterTime) FROM Agents AS ag INNER JOIN Info ON Info.SimId = ag.SimId GROUP BY ag.Prototype;",
"trans":
"SELECT tr.Time,tr.Commodity,snd.Prototype,rcv.Prototype,rs.Quantity FROM Transactions AS tr INNER JOIN Resources AS rs ON rs.ResourceId = tr.ResourceId INNER JOIN Agents AS snd ON tr.SenderId = snd.AgentId INNER JOIN Agents AS rcv ON tr.ReceiverID = rcv.AgentId ORDER BY tr.Time,snd.Prototype,rcv.Prototype;"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment