I just ran into some problem in beego orm. how to make a query with random order?
something like:
orm.NewOrm().QueryTable("tbl").OrderBy("rand()").Limit(1).All(&table)
but it gives panic result
I look at the documentation, but can't find that work for random result. any help is much appreciated.
Thank you in advance!
BeeGo ORM doesn't support ordering by methods, only by mapped fields:
https://github.com/astaxie/beego/blob/master/orm/db_tables.go#L434