concat the output of the subquery?

Use group_concat :

This function returns a string result with the concatenated non-NULL values from a group. It returns NULL if there are no non-NULL values.

SELECT
  GROUP_CONCAT(id)
FROM
  videos
WHERE
  duration=0

Try using GROUP_CONCAT

     GROUP_CONCAT([DISTINCT] expr [,expr ...]
         [ORDER BY {unsigned_integer | col_name | expr}
             [ASC | DESC] [,col_name ...]]
         [SEPARATOR str_val])

Reference: http://dev.mysql.com/doc/refman/5.0/en/group-by-functions.html#function_group-concat


This is what group_concat does.

select group_concat(id) as video_list
from videos 
where duration=0

Tags:

Mysql