QgsExpression using complex sql and python subsitution

المشرف العام

Administrator
طاقم الإدارة
I have a sql statement i am running in postgres fine and would like to transfer it to a QgsExpression mainly because I have loaded the layer in Qgis.
My sql is:
select column a,column b from table1 GROUP BY column a,column b ORDER BY column b DESC limit 20. I do not know how to do so. Can I use python substitution when creating an expression.

expr = QgsExpression( "%s = 99" )% column a

أكثر...
 
أعلى