How can I modify this query so that if it does not find results from a demo_id in the tags table instead of showing the demo in the answer where the tags should go, say something like no category
.
Inquiry
SELECT 'i'.'name', 'i'.'id', 'i'.'img', 'd'.'url', GROUP_CONCAT(t.name SEPARATOR ', ') as tags FROM 'demos' i INNER JOIN 'details' d ON 'i'.'id' = 'd'.'demo_id' INNER JOIN tags t ON t.demo_id = i.id GROUP BY 'i'.'id' ORDER BY 'i'.'created_at' ASC
Answer
{
"name": "4",
"id": "beqvok",
"img": "https://xx-xx.s3.amazonaws.com/demos/1491416271916",
"url": "http://xxx/cms/demos",
"tags": "ReactJS, NodeJS"
}
How can I do so that if I delete ReactJS and NodeJS that have the id beqvok
in the case of that demo instead of not showing up, show me something like this
{
"name": "4",
"id": "beqvok",
"img": "https://xx-xx.s3.amazonaws.com/demos/1491416271916",
"url": "xxx/cms/demos",
"tags": "No Category"
}