06-12-03, Wojciech Ziniewicz wojciech.ziniewicz@gmail.com napisał(a):
Witam, Chce wybrać limit pakietów/s dla kazdego komputera klienta , ktory to limit jest przypisany w taryfie kazdemu klientowi........ męcze się od dluższego czasu i nic - fachowcy od mysqla - pomóżcie :)
Z modules/tc/tc.c: ures = g->db_query(g->conn, "\ SELECT customerid AS id, \ SUM(uprate)/COUNT(DISTINCT nodes.id) AS uprate, \ SUM(downrate)/COUNT(DISTINCT nodes.id) AS downrate, \ SUM(upceil)/COUNT(DISTINCT nodes.id) AS upceil, \ SUM(downceil)/COUNT(DISTINCT nodes.id) AS downceil, \ SUM(climit)/COUNT(DISTINCT nodes.id) AS climit, \ SUM(plimit)/COUNT(DISTINCT nodes.id) AS plimit \ FROM assignments \ LEFT JOIN tariffs ON (tariffid = tariffs.id) \ LEFT JOIN nodes ON (customerid = ownerid) \ WHERE access = 1 AND (datefrom <= %NOW% OR datefrom = 0) AND (dateto >= %NOW% OR dateto = 0) \ GROUP BY customerid \ ORDER BY customerid");