Postgresql 9.2
It is necessary to display all these queries below in one table (I collect statistics)
SELECT "customer"."id", "customer"."email", "customer"."unsubscribed_types" FROM "customer" WHERE "customer"."unsubscribed_types" = 'daily_weekdays' OR "customer"."unsubscribed_types" = 'daily_weekends' OR "customer"."unsubscribed_types" = 'weekly_free' OR "customer"."unsubscribed_types" = 'weekly_best_weekly' OR "customer"."unsubscribed_types" = 'special_partner' OR "customer"."unsubscribed_types" = 'bonus_activation' LIMIT 100; SELECT "customer".email, "customer".id, "customer".unsubscribed_types FROM "customer" WHERE "customer".unsubscribed_types ISNULL OR "customer".unsubscribed_types = '' LIMIT 100; SELECT "customer".email, "customer".id, "customer".unsubscribed_types FROM "customer" WHERE "customer".unsubscribed_types = 'daily_weekdays' AND "customer".unsubscribed_types = 'daily_weekends' AND "customer".unsubscribed_types = 'weekly_free' AND "customer".unsubscribed_types = 'weekly_best_weekly' AND "customer".unsubscribed_types = 'special_partner' AND "customer".unsubscribed_types = 'bonus_activation'; LIMIT 100; SELECT "customer".id, "customer".email, "customer".unsubscribed_types FROM "customer" WHERE unsubscribed_types = 'daily_weekdays'; LIMIT 100; Please note I do not combine and display statistics (for example)
------------------------------------------------- | Запрос 1 | Сколько нашел людей из 1-го селекта| |-----------------------------------------------| | Запрос 2 | Сколько нашел людей из 2-го селекта| |-----------------------------------------------| | Запрос 3 | Сколько нашел людей из 3-го селекта| |-----------------------------------------------| | Запрос 4 | Сколько нашел людей из 4-го селекта| -------------------------------------------------