10/6/2017 - 10:15 AM

Capsulate Sub-query Data in Group

This non-generic query retrieves the collection of encapsulated data (by HTML) from a sub query. Each sub record is covered with html element and separating record with others by html element known as "hr"

    	select concat(u.first_name,' ',u.last_name) as supplier_name from user u where = d.provider_id
    ) as supplier,, 
    	select concat(u.first_name,' ',u.last_name) as host_name from user u where = d.created_by
    ) as host, 
      select concat(u2.first_name,' ',u2.last_name,'<a class="remove-adder" id="',,'"><i class="fa fa-times-circle"></i></a>') as added_by_users from user u2 where = ud.user_id
    ) SEPARATOR '<hr>') as added_by, 
from deal d
left join user_deals ud
on ud.deal_id =
group by
order by desc