Если я вас правильно понимаю, простой GROUP BY
, в котором не указаны только типы подписки maxium, должен помочь.
SELECT dupAlias.bar_id
, dupAlias.bar_name
, dupAlias.town_name
, dupAlias.bar_telephone
, MAX(dupAlias.subscription_type_id) AS subscription_type_id
FROM (
SELECT bar_id
, bar_name
, town_name
, bar_telephone
, (subscription_type_id *2) AS subscription_type_id
FROM bar
, sportactivitybar
, towns
, subscriptiontype
WHERE sport_activity_id_fk =14
AND bar_id = bar_id_fk
AND town_id = town_id_fk
AND subscription_type_id = subscription_type_id_fk
UNION
SELECT bar_id
, bar_name
, town_name
, bar_telephone
, subscription_type_id
FROM bar
, towns
, subscriptiontype
WHERE town_id = town_id_fk
AND subscription_type_id = subscription_type_id_fk
) dupAlias
GROUP BY
dupAlias.bar_id, dupAlias.bar_name, dupAlias.town_name, dupAlias.bar_telephone
ORDER BY
dupAlias.subscription_type_id DESC , RAND( )