如何从mysql django查询结果中获取数字?

时间:2017-04-17 04:03:51

标签: python mysql django

如何从这个django mysql查询中获取数字?

Transaksi.objects.extra(select={'hasil':"Select sum(nominal) from transaksi_kas_transaksi as t Inner JOIN datapribadisiswa_datapribadisiswa as d on t.nis=d.SiswaNIS WHERE d.SiswaKelas_id=6"},where=["kode_pem='01' AND month(tanggal)=8 And (tanggal>=%s and tanggal<=%s)"],params=['2016-07-01','2017-06-30']).values_list('hasil', flat=True)

这是结果

((Decimal('410000'),), (Decimal('410000'),), (Decimal('410000'),), (Decimal('410000'),), (Decimal('615000'),), (Decimal('410000'),), )

如何从结果中获取数字?

0 个答案:

没有答案