Here is what I would like to be able to do
I have the following tables:
#1 Employees
id
firstName
lastName
#Tasks
id
employeeID
description
flag
I want to Join the tables, and return the employee result from employee, regardless if there are joining rows in the Tasks table. So therefore I will be using a Left Outer Join, like this:
SELECT employees.firstName, employees.lastName, Tasks.*
FROM employees LEFT OUTER JOIN
tasks ON employees.id = tasks.emplyeeID
WHERE (employee.id = 119)
***HOWEVER***, this is the tricky part. I want to narrow the returned Tasks to join on. I would also like to say, where Tasks.flag=1. But if there are no relating rows in the Tasks table, regardless of the Left Outer Join, nothing is returned.
Please, any help would be appreciated. I have been fighting over this one for awhile.
Thanks
FC
I have the following tables:
#1 Employees
id
firstName
lastName
#Tasks
id
employeeID
description
flag
I want to Join the tables, and return the employee result from employee, regardless if there are joining rows in the Tasks table. So therefore I will be using a Left Outer Join, like this:
SELECT employees.firstName, employees.lastName, Tasks.*
FROM employees LEFT OUTER JOIN
tasks ON employees.id = tasks.emplyeeID
WHERE (employee.id = 119)
***HOWEVER***, this is the tricky part. I want to narrow the returned Tasks to join on. I would also like to say, where Tasks.flag=1. But if there are no relating rows in the Tasks table, regardless of the Left Outer Join, nothing is returned.
Please, any help would be appreciated. I have been fighting over this one for awhile.
Thanks
FC