I have a table with several readings_miu_id, each with multiple RSSI readings (RSSI is also a field name). So, currently I have a data table with many columns, but the two corresponding to this conversation look something like this:
readings_miu_id RSSI
11011032 -90
11011032 -81
11011032 -62
11011032 -84
11011032 -86
11010084 -84
11010084 -86
11010084 -87
etc.
My initial plan was to change the RSSI value for each post with the same readings_miu_id with the average RSSI for this readings_miu_id (which should look the same as above, except that the separate RSSI will be replaced by the average RSSI for this miu) and then pull out only one entry for each individual readings_miu_id (which I'm pretty sure I can do this with the select top 1 statement). However, I am having trouble calculating the first part. The sql statements I tried look like they should be close:
UPDATE analyzedCopy2 as A
SET analyzedCopy2.RSSI = Avg(RSSI)
where readings_miu_id = A.readings_miu_id
and
UPDATE analyzedCopy2 as A
SET RSSI = Avg(select RSSI from analyzedCopy2
where readings_miu_id = A.readings_miu_id)
WHERE readings_miu_id = A.readings_miu_id;
Help me please!
Bryan source
share