SELECT
	UNIX_TIMESTAMP(server_time),
	FLOOR(current_signal) AS signal,
	FLOOR(current_noise) AS noise,
	snr,
	IF(hwtype = "bcm", 1 - (rx_packets / (rx_packets + rx_fifo + rx_drop + rx_error + rx_frame)), 1 - (rx_packets / (rx_packets + madwifi_rx_crc + madwifi_rx_phy))) AS PER,
	server_time

FROM reports
LEFT JOIN hwtype_mac USING(node_mac)

WHERE node_mac = "XMACX"

ORDER BY server_time ASC
