Mailinglisten-Archive |
Reinhold Jordan wrote:
> Hallo,
>
>
>> SELECT `table_1`.`recieve` - `table`.`recieve`,
>> ...
>> FROM `table`
>>LEFT JOIN `table` AS `table_1`
>> ON `table_1`.`timestamp` / 600
>> BETWEEN `table`.`timestamp` / 600
>> AND (`table`.`timestamp` + 1200) / 600
>>
>>oder so ähnlich, weiß jetzt nicht genau ob das mit den Timestamp werten
>>genau so hinheut, eventuell muss man noch umwandeln zwischendurch,
>>glaube aber nicht.
>
>
> Danke.
>
> Mmmm table ist der Tabellenname? Also traffic_eth? Dann sieht das
> so aus (?):
>
> SELECT table_1.recieve - traffic_eth.recieve
> FROM traffic_eth
> LEFT JOIN traffic_eth AS table_1
> ON table_1.timestamp / 600
> BETWEEN traffic_eth.timestamp / 600
> AND (traffic_eth.timestamp + 1200) / 600
>
> MySQL said:
>
> Unknown column 'table_1.recieve' in 'field list'
war nen Tipp-Fehler
>
> Wirklich verstehen tue ich das nicht :|
SELECT traffic_eth.timestamp,
traffic_eth.receive - traffic_eth_last.receive,
traffic_eth.transmit - traffic_eth_last.transmit
FROM traffic_eth
LEFT JOIN traffic_eth AS traffic_eth_last
ON UNIX_TIMESTAMP( traffic_eth_last.timestamp )
BETWEEN UNIX_TIMESTAMP( traffic_eth.timestamp ) - 450
AND UNIX_TIMESTAMP( traffic_eth.timestamp ) - 150
subtrahiert den Datensatz der zwischen 2,5 und 7,5 Minuten zurücklag
--
Sebastian Mendel
www.sebastianmendel.de www.warzonez.de www.tekkno4u.de www.nofetish.com
www.sf.net/projects/phpdatetime www.sf.net/projects/phptimesheet
--
Infos zur Mailingliste, zur Teilnahme und zum An- und Abmelden unter
-->> http://www.4t2.com/mysql
php::bar PHP Wiki - Listenarchive