Hello.
Maybe this could help.
SELECT t1.Users_Code,
IF( t1.Affected_Member IS NULL, 'No entry in Table2',
IFNULL( t2.Member_Surname, t2.Member_Groupname)
) AS NAME
FROM Table1 t1
LEFT JOIN Table2 t2 ON t1.Affected_Member = t2.Member_Code;
++-
Hi,
You should be able to do a join on both tables and use the IF function in the
select. It would look something like
select if(Table1.MemberName='', Table2.Member_GroupName, Table1.MemberName) as
name from Table1 left join Table2 on ...
I cannot guess how your tables are related to each other