Note that there are some explanatory texts on larger screens.

plurals
  1. POSyntax Error at or near the word join
    primarykey
    data
    text
    <p>I'm using the following Select statement to retrieve and count the total of each field across multiple tables. However when it comes to executing the statement i get the error "Syntax Error at or near the word join"</p> <p>Any help would be greatly appreciated</p> <p><strong>Query:</strong></p> <pre><code>Select CompanyStatus,Companyname, INNER JOIN Company on usersincompany.companyID=company.companyID, INNER JOIN company on users.companyID=Company.companyID, INNER JOIN usersincompany on users.userid=usersincompany.userid, INNER JOIN users on userstatus.userstatudid=users.userstatusid, INNER JOIN users on project.companyid=users.companyid, INNER JOIN users on usersession.userid=users.userid, INNER JOIN project on template.projectid=project.projectid, INNER JOIN project on merchendisingarea.projectid=project.projectid, INNER JOIN merchendisingarea on publishstatus.publishstatusid=merchendisingarea.publishstatusid, INNER JOIN template on merchendisingmodule.templateid=template.templateid, INNER JOIN company on companyaccountclassification.classificationtypeid=company.classificationtypeid, sum(distinct users.userid) as TotalUsers, sum(case when users.userstatusid =2 then 1 else 0 end) as Activeusers, sum(case when users.userstatusid =3 then 1 else 0 end) as SuspendedUsers, sum(distinct usersessionid) as TotalLogin, sum(distinct merchendisingmoduleid) as CurrentModules, count( merchendisingmodule.createddate) as Modulescreated, count( merchendisingmodule.updateddate) as Modulesupdated, sum(distinct merchendisingareaid) as Currentareas, count( merchendisingarea.createddate) as AreasCreated, count( merchendisingarea.updateddate) as Areasupdated, sum(case when publishingstatus.publishstatusid =1 then 1 else 0 end) as SuccessPublished, sum(case when publishingstatus.publishstatusid =3 then 1 else 0 end) as FailedPublished from users,company,merchendisingmodule,merchendisingarea,publishingstatus, usersession group by companystatus, companyname </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload