thanks for that, I'm using MYSQL (should have said so in the OP).
I found the IFNULL keyword which works...
Code:SELECT a.x, a.y, a.z, IFNULL(b.x,'bxDefault') as bX, IFNULL(b.y,'byDefault') as bY, IFNULL(b.z,'bzDefault') as bZ, FROM tableA a LEFT JOIN tableB b ON a.x=b.x AND b.w="somevalue"




Reply With Quote