我尝试过一种sql,但无法工作。select cname,avg(salary) from Company as co,Works as wo where co.cid=wo.cid and wo.salary > (select avgcity varchar(6))创建table公司(cid,cname varchar(6),city varchar(6))alter作品添加
显然,我可以使用for循环,但我试图找到一种更有效的方法(可能使用原始SQL)。模型大致如下:它们通过外键链接(例如,Question模块有一个指向Module的外键)。__gt=0).exclude(avg_score__isnull=True).order_by('avg_score')
for question in questi