之前类似的问题可以追溯到2012年,但没有解决,所以我不得不重新问。
struct type DualTable{
table1 []Table1
table2 []Table2
}
struct type Table1{
A string
B string
}
struct type Table2{
P string
Q string
}
var dualtable []DualTable
var table1 []Table1
var table2 []Table2
func main(){
//trial 1 :failed as i get only table1 result
db.Raw("select * from table1 select * from table2").Scan(&table1).Scan(&table2)
//trial 2 :failed as i get only table2 result
db.Raw("select * from table2 select * from table1").Scan(&table1).Scan(&table2)
//trial 3 : failed as got nothing
db.Raw("select * from …Run Code Online (Sandbox Code Playgroud)