摘要:
批量插入数据 l = [] # for i in range(100000): # res=models.Book(title='第%s本书' % i) # l.append(res) # models.Book.objects.bulk_create(l) # # select * from bo 阅读全文
摘要:
聚合查询 # 聚合查询 max min avg sum count from django.db.models import Max, Min, Sum, Count, Avg # 可以起别名 # res = models.Book.objects.aggregate(max_price=Max(' 阅读全文