below can work? select config_id, start_day as day, start_time, end_time from config union select config_id, end_day as day, start_time, end_time from config
-- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general