0 - 1 of 1 tags for select columns

Hello,
 
I have been struggling with this concept and any help would be highly appreciated. Do we need a stored procedure here?
 

Table 1