Untitled
unknown
pgsql
2 years ago
3.3 kB
10
Indexable
select
opportunity."Id" identificator,
opportunity."Title" title,
opportunity."CreatedOn" + interval '3 hours' created_on,
createdby."Name" as created_by,
opportunity."ModifiedOn" + interval '3 hours' as modified_on,
modifiedby."Name" as modified_by,
type."Name" as type,
stage."Name" as stage,
owner."Name" as owner,
opportunity."Notes" as notes,
opportunity."AccountId" as account_identificator,
category."Name" as category,
contact."Name" as contact,
opportunity."Description" as description,
opportunity."SmExternalCode" as sm_external_code,
opportunity."PartnerId" as sm_parent_id,
contract."Number" as contract_number,
opportunity."SmLeadFirstId" as first_lead_id,
segment."Name" as segment,
opportunity."SmBrandId" as brand_identificator,
opportunity."SmIntegrationChat" as integration_chat,
opportunity."SmContentTask" as content_task,
opportunity."SmIsDeliveryAreaLoaded" as delivery_area_loaded,
opportunity."SmLinkAdmin" as link_admin,
opportunity."SmIsContentIntegrationComplete" as content_integration_complete,
opportunity."SmIsInstalledPhoto" as installed_photo,
opportunity."SmDuplicateByNameId" as duplicated_by_name_id,
content_status."Name" as content_status,
loss_reason."Name" as loss_reason,
opportunity."SmLossComment" as loss_comment,
opportunity."SmIsPartnerLoadsMenu" as partner_loads_menu,
opportunity."SmIsIntegration" as is_integration,
opportunity."SmChatPhotoShoot" as chat_photoshoot,
opportunity."SmLinkFoodPhoto" as link_food_photo,
opportunity."SmLinkFoodTable" as link_food_table,
opportunity."SmLinkPhoto" as link_photo,
opportunity."SmAddConnectionRest" as add_conection_rest,
opportunity."SmPhotoShootRequired" as photoshoot_required,
vertical."Name" as vertical,
connection_status."Name" as connection_status,
opportunity."SmIsShowcaseReady" as is_showcase_ready
from "Opportunity" opportunity
left join "Contact" createdby
on createdby."Id" = opportunity."CreatedById"
left join "Contact" modifiedby
on modifiedby."Id" = opportunity."ModifiedById"
left join "OpportunityType" type
on type."Id" = opportunity."TypeId"
left join "OpportunityStage" stage
on stage."Id" = opportunity."StageId"
left join "Contact" owner
on owner."Id" = opportunity."OwnerId"
left join "OpportunityCategory" category
on category."Id" = opportunity."CategoryId"
left join "Contact" contact
on contact."Id" = opportunity."ContactId"
left join "Contract" contract
on contract."Id" = opportunity."ContactId"
left join "SmSegment" segment
on segment."Id" = opportunity."SmSegmentId"
left join "SmOpportunityContentStatus" content_status
on content_status."Id" = opportunity."SmRecommendationStatusId"
left join "SmOpportunityLossReason" loss_reason
on loss_reason."Id" = opportunity."SmLossReasonId"
left join "SmOpportunityVertical" vertical
on vertical."Id" = opportunity."SmVerticalId"
left join "SmConnectionStatus" connection_status
on connection_status."Id" = opportunity."SmConnectionStatusId"
Editor is loading...
Leave a Comment