Se la sum la fai nella parte select non c'è bisogno di farla anche nella clausola ORDER BY.
Prova così:
codice:
sql1="select pl.id as pid,sum(pr.beds) as letto from properties_list pl, estates_list pr where pr.property=pl.id and pl.type=4 order by pr.beds desc group by pl.id"
o così:
codice:
sql1="select pl.id as pid,sum(pr.beds) as letto from properties_list pl, estates_list pr where pr.property=pl.id and pl.type=4 order by 2 desc group by pl.id"
oppure ancora così:
codice:
sql1="select pl.id as pid,sum(pr.beds) as letto from properties_list pl, estates_list pr where pr.property=pl.id and pl.type=4 order by letto desc group by pl.id"
Una delle tre dovrebbe andare.