Structs
type Client struct {
Id int64
Name string
}
type Trade struct {
Id int64
ClientId int64
Client *Client
}
Query
db.Model(&Trade).Where("id = ", tradeId).Relation("Client").Select()
Error encountered: Column Id ambiguous. Not sure what's the proper way to work around this Would be great if someone can help
You may try qualifying the
Id
column with either an alias or the full table name, e.g.