Your application or website rely on your database to deliver information about products and services to your customers. You can’t afford to have your database lose performance, lose availability or become unresponsive – even for just a few minutes.
SELECT public.assets.first_name, public.assets.last_name, CASE WHEN public.project_markets.market IS NULL THEN 'Corporate' ELSE public.project_markets.market END, CASE WHEN events.event_log.event_id = 3 THEN MIN(events.event_log.timestamp) END AS package_assignment, CASE WHEN events.event_log.event_id = 1 THEN MIN(events.event_log.timestamp) END AS form_download, CASE WHEN events.event_log.event_id = 2 THEN MIN(events.event_log.timestamp) END AS form_upload, closeout.packages.name as package_name FROM events.event INNER JOIN events.event_log ON ( events.event.id = events.event_log.event_id) INNER JOIN public.assets_user_xref ON ( events.event_log.user_id = public.assets_user_xref.user_id) INNER JOIN public.assets ON ( public.assets_user_xref.assets_id = public.assets.id) FULL OUTER JOIN public.unitek_pcs ON ( public.assets.pc6 = public.unitek_pcs.pc6) FULL OUTER JOIN public.project_pc_market_xref ON ( public.unitek_pcs.id = public.project_pc_market_xref.pc_id) FULL OUTER JOIN public.project_markets ON ( public.project_pc_market_xref.market_id = public.project_markets.id) INNER JOIN public.project_instance_people ON ( public.assets.id = public.project_instance_people.asset_id) INNER JOIN closeout.package_instances ON ( public.project_instance_people.project_instance_id = closeout.package_instances.project_id) INNER JOIN closeout.packages ON ( closeout.package_instances.package_id = closeout.packages.id) WHERE events.event_log.event_id IN (3, 2, 1) GROUP BY public.assets.first_name, public.assets.last_name, public.project_markets.market, events.event.name, events.event_log.event_id, packages.name;
Add your voice to the tech community where 5M+ people just like you are talking about what matters.
Join the community of 500,000 technology professionals and ask your questions.