Using Multiplication in the DQL Doctrine Order by clasuse

I am using doctrine 2.1 DQL and I want to get table data in this order:

SELECT u FROM User u ORDER BY us * ut 

s and t are the two displayed column fields on the user.

But I get a QueryException.

Can anybody help me?

+4
source share
1 answer

this should do the trick:

 SELECT u, (us * ut) AS multiplication FROM User u ORDER BY multiplication 
+5
source

Source: https://habr.com/ru/post/1384602/


All Articles