Quick question. I have a database of real estate, and the values Price and Floorsize, which is an integer of the property's square metreage. Normally I would order by price or floorsize, but this time I want to order by the price per sqm. Is there anyway I can do this in SQL. Maybe
SELECT * FROM Properties ORDER By (Price / Floorsize)
That is a guess. Any help gratefully received.
Your guess is right. It is the same way you posted in your question. Like so:
SELECT *
FROM Properties ORDER BY (Price / Floorsize);
As Mahmoud answered the right solution, here is another one should You need to also select the price per sqm value:
SELECT *, (Price / Floorsize) ppsqm FROM Properties ORDER BY ppsqm;