我是GOlang和GORM的新手,我对如何使用GORM进行多个表连接有一些困惑。
示例:
表:
Department - Fields (gorm.Modal, dep_name)
Employee - Fields (gorm.Modal, emp_id, emp_name, department_id) //employee is department table child
EmployeeContact - Fields (gorm.Modal, employee_id, emp_contact_no)//Employee contact table is employee table child查询
SELECT * FROM department d, employee e, employeeContact ec WHERE d.id = e.department_id and e.id = ec.employee_id如何使用GORM进行上述查询?
https://stackoverflow.com/questions/51244274
复制相似问题