Link to home
Start Free TrialLog in
Avatar of Aleks
AleksFlag for United States of America

asked on

better sql syntax

I have the following query, can we make it better?  Please refer to my prev posting as example, that worked real nice.

--

SELECT activities.activityid, activities.ActName, activities.actdesc,activities.dateinitiated,activities.lastmodified,activities.processtep,activities.Partylist
FROM ((dbo.Activities LEFT JOIN dbo.Cases ON dbo.Activities.CaseId = dbo.Cases.Id) )  
LEFT JOIN dbo.Atts ON dbo.Atts.CaseId = dbo.Cases.Id  
INNER JOIN Users ON Activities.sent_by = Users.UserId
WHERE Activities.FirmId = 2   AND  (Activities.ActType = 'Calendar')   AND sent_by = 1713

---

Aleks
ASKER CERTIFIED SOLUTION
Avatar of lludden
lludden
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Aleks

ASKER

What indexes do you have on the tables?
Avatar of Aleks

ASKER

I have the attached, I am not too familiar with indexes and if more should be created or not.  User generated image
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Aleks

ASKER

Thank you.