Created
April 12, 2019 17:00
-
-
Save ssz66666/0067a505db2cd968acf6b00412e12485 to your computer and use it in GitHub Desktop.
sql query mhealth
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 timestamp, subject_id, activity_id, | |
chest_acc_x, chest_acc_y, chest_acc_z, | |
left_ankle_acc_x, left_ankle_acc_y, left_ankle_acc_z, | |
left_ankle_gyro_x, left_ankle_gyro_y, left_ankle_gyro_z, | |
left_ankle_magn_x, left_ankle_magn_y, left_ankle_magn_z, | |
right_lower_arm_acc_x, right_lower_arm_acc_y, right_lower_arm_acc_z, | |
right_lower_arm_gyro_x, right_lower_arm_gyro_y, right_lower_arm_gyro_z, | |
right_lower_arm_magn_x, right_lower_arm_magn_y, right_lower_arm_magn_z | |
FROM uci_mhealth__samples, | |
(SELECT sample_id as sid_1, acc_x as chest_acc_x, acc_y as chest_acc_y, acc_z as chest_acc_z FROM uci_mhealth__sensor_readings WHERE location = 1), | |
(SELECT sample_id as sid_2, acc_x as left_ankle_acc_x, acc_y as left_ankle_acc_y, acc_z as left_ankle_acc_z, | |
gyro_x as left_ankle_gyro_x, gyro_y as left_ankle_gyro_y, gyro_z as left_ankle_gyro_z, | |
magn_x as left_ankle_magn_x, magn_y as left_ankle_magn_y, magn_z as left_ankle_magn_z FROM uci_mhealth__sensor_readings WHERE location = 2), | |
(SELECT sample_id as sid_3, acc_x as right_lower_arm_acc_x, acc_y as right_lower_arm_acc_y, acc_z as right_lower_arm_acc_z, | |
gyro_x as right_lower_arm_gyro_x, gyro_y as right_lower_arm_gyro_y, gyro_z as right_lower_arm_gyro_z, | |
magn_x as right_lower_arm_magn_x, magn_y as right_lower_arm_magn_y, magn_z as right_lower_arm_magn_z FROM uci_mhealth__sensor_readings WHERE location = 3) | |
WHERE uci_mhealth__samples.sample_id = sid_1 AND uci_mhealth__samples.sample_id = sid_2 AND uci_mhealth__samples.sample_id = sid_3; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment