↧
Answer by Ronald Aaronson for Mysql Left Join with WHEN clause, WHERE and...
I am only interested in rows from table B.XYZ supplying missing values for rows in table A.ABC for which column pid = 0. So: select t1.mid, t1.pid, if(t2.id is null, t1.pName, concat_ws(' ',...
View ArticleAnswer by qristjan for Mysql Left Join with WHEN clause, WHERE and CONCATE
SELECT a.mId AS mId, CASE WHEN (a.pId = 0 OR a.pId IS NULL) THEN x.id ELSE a.pId END AS pId, CASE WHEN (x.firstname IS NOT NULL) THEN CONCAT(x.firstname, ' ', x.lastname) ELSE a.pName END as pName,...
View ArticleMysql Left Join with WHEN clause, WHERE and CONCATE
I am trying to solve one mysql query. I have TWO Databases e.g. A and B. Database A has table ABC and Database B has table XYZ. Joining condition phoneno from ABC = phoneno or cellphone from XYZ. ABC...
View Article
More Pages to Explore .....