SELECT mp3_users_playlists id mp3_users_playlists name DATE_FORMAT mp3

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
SELECT `mp3_users_playlists`.`id`, `mp3_users_playlists`.`name`, DATE_FORMAT(`mp3_users_playlists`.`dateadd`, '%d.%m.%y, %k:%i') AS `dadd`,
(SELECT COUNT(`playlist_id`) FROM `mp3_playlists` WHERE `mp3_users_playlists`.`id`=`mp3_playlists`.`playlist_id`) AS `cnt`,
(SELECT GROUP_CONCAT(`mp3_playlists_tags`.`name` SEPARATOR ', ' ) AS 'Data'
FROM `mp3_playlists_tags`
WHERE `mp3_playlists_tags`.`pls_id`=`mp3_users_playlists`.`id`
GROUP BY `mp3_users_playlists`.`id`) AS `tags`
FROM `mp3_users_playlists`
INNER JOIN `mp3_playlists_tags`
ON `mp3_playlists_tags`.`pls_id`=`mp3_users_playlists`.`id`
INNER JOIN `mp3_playlists`
ON `mp3_playlists`.`playlist_id`=`mp3_playlists_tags`.`pls_id`
INNER JOIN `mp3_main`
ON `mp3_playlists`.`song_id`= `mp3_main`.`id`
WHERE MATCH `artist`, `title` AGAINST ('madonna')
GROUP BY `id`