Tell me how to make a request so that it is sorted by the sum of two fields, for example:
SELECT "name","prais1","prais2" FROM "tovari",
I need the query to be sorted in ascending order prais1+prais2
Tell me how to make a request so that it is sorted by the sum of two fields, for example:
SELECT "name","prais1","prais2" FROM "tovari",
I need the query to be sorted in ascending order prais1+prais2
SELECT name, paris1, paris2, (paris1+paris2) as paris FROM `tovari` ORDER BY paris
SELECT name, prais1, parais2, SUM(prais1 + parais2) as myfield FROM tovati ORDER BY myfield
Source: https://ru.stackoverflow.com/questions/26256/
All Articles