From: Benjamin Kalytta on
Hello again,

unfortunately it doesn't work as expected. SQL CE says, it can't find
column C.Metric

> JOIN (SELECT RouterId, DeviceId, MIN(ABS(C.Metric - Metric)) AS
min_metric

So I think it's time to find another solution. May be I could call that
query for each DeviceId, but SQL CE on my smart device is really slow as
it is.

Benjamin Kalytta