Advertisement
Guest User

Untitled

a guest
Dec 18th, 2014
186
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
SQL 0.90 KB | None | 0 0
  1. SELECT ops.finename AS operator_name, s.text AS status_name, SUM(c.cnt) AS cnt, ops.E212, 'outgoing' AS way, ops.Country, c.STATUS FROM OPER_STAT c , operators ops, statuses s WHERE c.src_oper_id IN (255) AND c.src_hub_id IS NULL AND c.src_oper_id NOT IN (79,410,500,1005,1006,1023,1036,1048,1104,1108,1117,1118,1119,1121,1122,1126,1128,1129,1130,1137,1152,1158,1159,1160,1163,1165,1168,1170,1173,1180,1183,1186,1193,1196,1199,1200,1201,1202,1217,1326,1353,1361,1368,1414,1460) AND c.dst_oper_id NOT IN (79,410,500,1005,1006,1023,1036,1048,1104,1108,1117,1118,1119,1121,1122,1126,1128,1129,1130,1137,1152,1158,1159,1160,1163,1165,1168,1170,1173,1180,1183,1186,1193,1196,1199,1200,1201,1202,1217,1326,1353,1361,1368,1414,1460) AND c.dt BETWEEN '2014-12-01 00:00:00' AND '2014-12-18 23:59:59' AND c.dst_oper_id = ops.id AND s.id = c.STATUS AND ops.ID=360 GROUP BY operator_name, s.id ORDER BY s.sort_order ASC, cnt DESC
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement