This is my database schema:
Post:
id
title
body
date
Tag:
id
title
Post_Tag:
id
id_post
id_tag
Comment:
id
id_post
body
date
and this is my query:
SELECT
Post.id AS post_id,
Post.title AS post_title,
Post.body AS post_body,
GROUP_CONCAT(CONCAT(Tag.id, "|", Tag.title) SEPARATOR '#') AS tags,
COUNT(Comment.id) AS comment_count
FROM Post
LEFT JOIN Comment ON Post.id = Comment.id_post
LEFT JOIN Post_Tag ON Post.id = Post_Tag.id_post
LEFT JOIN Tag ON Tag.id = Post_Tag.id_tag
GROUP BY Post.id
ORDER BY Post.date ASC
Someone can tell me why I am getting these strange results ( [BLOB - ... ] ) below in the tags column ?
id title body tags comment_count
1 hello guys blablabla... [BLOB - 8B] 8
2 hello all blablabla... [BLOB - 14B] 3
3 how to tell blablabla... [BLOB - 8B] 5
4 hello world blablabla... [BLOB - 5B] 7