SQL question: How to
Hi! I have a table 'distance' like this: Distance || planned_price || actual_price 70 || 13 || 11 120 || 15 || 15 44 || 8 || 12 88 || 10 || 20 ................. Is it possible to get the output like: Distance || 1-5 higher || 6-10 higher || in range || below range under 50 || 25% || || || 50-100 || || 25% || || 25% over 100 || || || 25% || I need to compare 'actual_price' with 'planned_price' and defined it is higher, below, or in range. Then group by distance and count %. But i have no idea how to query it and even if possible is it or not?