I have two tables: employee and department table. I want to join these two tables like the SQL query below.
SELECT employee.name,department.deptname FROM employee, department WHERE employee.deptid = department.id AND employee.country = 'Germany' AND department.deptname in ('IT', 'HR')
How to combine these two tables based on the condition?
You can use correlated subquery if deptid is an ObjectId.