SELECT x.name FROM (SELECT IF(t.name IS NULL or t.name = '', e.name, t.name) as name FROM users u LEFT JOIN teachers t ON U.id = t.user_id LEFT JOIN employees e on U.id = e.user_id) x
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)