Witam.
mam zapytanie sql:
SELECT x.id as id, 'marcin' AS UserName,
CONCAT(ROUND(COALESCE(x.upceil, y.upceil)),'k','/', ROUND(COALESCE(x.downceil, y.downceil)),'k') AS Value
FROM (
SELECT n.id, MIN(n.name) AS name, SUM(t.downceil) AS downceil, SUM(t.upceil) AS upceil
FROM nodeassignments na
JOIN assignments a ON (na.assignmentid = a.id)
JOIN tariffs t ON (a.tariffid = t.id)
JOIN nodes n ON (na.nodeid = n.id)
JOIN (
SELECT assignmentid, COUNT(*) AS cnt
FROM nodeassignments
GROUP BY assignmentid
) o ON (o.assignmentid = na.assignmentid)
WHERE (a.datefrom <= unix_timestamp() OR a.datefrom = 0)
AND (a.dateto > unix_timestamp() OR a.dateto = 0)
AND a.suspended = 0 AND n.name = 'marcin'
GROUP BY n.id
) x
RIGHT JOIN (
SELECT n.id, n.name, 64 AS downceil, 64 AS upceil
FROM nodes n WHERE n.name = 'marcin'
) y ON (1=1)
to zapytanie ładnie mi zwraca prędkość danego usera.
jak mogę wyświetlić dla wszystkich komputerów z publicznymi adresami?
--
Pozdrawiam
Marcin / nicraM