Quantcast
Channel: Mysql Left Join with WHEN clause, WHERE and CONCATE - Stack Overflow
Browsing latest articles
Browse All 3 View Live

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 Article


Answer 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 Article

Image may be NSFW.
Clik here to view.

Mysql 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
Browsing latest articles
Browse All 3 View Live




<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>