Created
April 16, 2012 16:01
-
-
Save letiro/2399663 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT SUM(x.length), | |
COUNT(x.port), | |
x.port | |
FROM (SELECT source_port AS port, | |
tcp_length AS length | |
FROM droid_tcp_segment | |
JOIN droid_proc_res_tcp_segmnets | |
ON tcp_segm_id = id | |
WHERE source_port < 1024 | |
AND droid_proc_res_id = 1 | |
UNION ALL | |
SELECT dest_port AS port, | |
tcp_length AS length | |
FROM droid_tcp_segment | |
JOIN droid_proc_res_tcp_segmnets | |
ON tcp_segm_id = id | |
WHERE dest_port < 1024 | |
AND droid_proc_res_id = 1 | |
UNION ALL | |
SELECT dest_port AS port, | |
length AS length | |
FROM droid_udp_packet | |
JOIN droid_proc_res_udp_packets | |
ON udp_packet_id = id | |
WHERE dest_port < 1024 | |
AND droid_proc_res_id = 1 | |
UNION ALL | |
SELECT source_port AS port, | |
length AS length | |
FROM droid_udp_packet | |
JOIN droid_proc_res_udp_packets | |
ON udp_packet_id = id | |
WHERE source_port < 1024 | |
AND droid_proc_res_id = 1) AS x | |
GROUP BY x.port |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment