SELECT url FROM mail_links WHERE link_id = :link_id SELECT count(*) as number_clicks , (com.category_id) as country_id , c.parent_id FROM mail_link_clicks mlc , category_object_map com, categories c WHERE mlc.link_id = :link_id AND mlc.mail_id = :mail_job_id AND mlc.user_id = com.object_id AND com.category_id = c.category_id group by country_id , c.parent_id order by country_id, c.parent_id