본문 바로가기
MySql

MySQL In Django, how do I select 100 random records from the database?

by 베이스 공부 2020. 11. 12.
반응형
myqueryset = Content.objects.filter(random 100)

 

해결 방법

 

Content.objects.all().order_by('?')[:100]


 

참조 페이지 https://stackoverflow.com/questions/3506678

 

 

반응형

댓글