We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
First, I create a numbered, ordered, table (doesn't matter if ASC or DESC).
Then, I calculate the midpoint (either 1 or 2 rows) and fetch only those rows.
After that, I just take the average of the rows fetched and voila! =)
Weather Observation Station 20
You are viewing a single comment's thread. Return to all comments →
I'm no SQL expert, but I feel like my solution is more readable and it works for even/uneven table records:
First, I create a numbered, ordered, table (doesn't matter if ASC or DESC). Then, I calculate the midpoint (either 1 or 2 rows) and fetch only those rows. After that, I just take the average of the rows fetched and voila! =)