Sehr gute Idee, Markus!
Deine Lösung ging noch nicht ganz, aber ich habs hinbekommen!
Diese Lösung geht nun
SQL-Code:
select
*,
(buy_count / view_count) as conversion
from
(
(select c.display_name,
(SELECT COUNT(*) from customer_viewed_coupons_view cvcv WHERE cvcv.city_id = c.id) as view_count,
(SELECT COUNT(*) from ordered_coupons_view ocv WHERE ocv.city_id = c.id) as buy_count
from cities c) as dummy
);
Vielen Dank!