I assume that after an empty value, if for B there is no value that has the same uid in A.
If so, IFNULL will return the default value that you specified if the parameter is null (ISNULL is used in MSSQL):
SELECT A.value, IFNULL(B.value, '') FROM A LEFT JOIN B ON A.uid = B.uid
This will result in something like:
test1 address1 test2 address2 test3 test4 address3
Pavel donchev
source share