tonelm54
asked on
Left join from SQL
Ive got an SQL query which is working great:-
Problem is I now only want it to look only in `call` where `cleared`=null or 0000-00-00 00:00:00, so something like:-
So need to do a subquery and pull the LEFT JOIN.
Im a little confused how I can do this, does anyone have any ideas or pointers?
Thank you
SELECT `paras`.`paraName`, `call`.`priID`
FROM `paras`
LEFT JOIN `call`
ON `paras`.`paraName` = `call`.`assignedTo`
ORDER BY `paras`.`paraName` ASC
Problem is I now only want it to look only in `call` where `cleared`=null or 0000-00-00 00:00:00, so something like:-
SELECT (SELECT * FROM `call` WHERE `timeClear` IS NULL or `timeClear` = '0000-00-00 00:00:00'; ) AS `paraName`, `call`.`priID`
FROM `paras`
LEFT JOIN `call`
ON `paras`.`paraName` = `call`.`assignedTo`
ORDER BY `paras`.`paraName` ASC
So need to do a subquery and pull the LEFT JOIN.
Im a little confused how I can do this, does anyone have any ideas or pointers?
Thank you
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER