In one method, I need to query different tables. How to clear the previous query criteria
The document you expected this should be explained
Expected answer
Comment From: ehabterra
I have found that some properties are not getting reset after executing the query. The workaround is to try to empty the cached table name property to be able to specify another table. Here is an example of how to do that:
var db *gorm.DB
// First query execution
...
// Reset table name
db.Statement.Table = ""
// Second query execution
...
Comment From: a631807682
https://gorm.cn/docs/method_chaining.html#New-Session-Mode