Пока наш код ниже, но он дает нам ошибку
Select LeadSource, (count(‘Inbound’) from Lead_T * 100 / select count (LeadSource) from Leads_T)) as percent
Where LeadID in( select stage
From opportunities_T
Where Opportunities_T.stage = ‘7-Closed/Won’)
Таблица 1:
create table Opportunities_T
(Executive varchar(50) not null,
AccountName varchar(150) not null,
Stage varchar(50) not null,
OpAmount int not null,
CloseDate date not null,
AccountStatus varchar(15) not null,
LeadID int not null,
constraint Opportunities_PK primary key (LeadID, AccountName),
constraint Opportunities_FK1 foreign key (LeadID) references Leads_T(LeadID),
constraint Opportunities_FK2 foreign key (AccountName) references Account_T(AccountName));
Таблица 2:
create table Leads_T
(Contact varchar(25),
Company varchar(100),
Title varchar(150),
LeadSource varchar(30),
BDR varchar(50),
LeadID int,
constraint Leads_PK primary key (LeadID));