Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>@ChaosPandion's comment about reformatting is a good idea, but perhaps you need some help understanding what good formatting is. Well, it's probably different for everyone :-) but if I was writing your query I'd format it as follows:</p> <pre><code>SELECT TOP (100) PERCENT a.Id, a.DateCreated, a.DateModified, a.LastUpdatedBy, a.AccomplishmentTypeId, a.Title, a.Description, a.ApplicableDate, a.LocalId, at.Name AS AccomplishmentTypeName, a.Name AS AreaName, u.FirstName, u.LastName, ug.Name AS UserGroupName, ugo.Name AS OtherUserGroupName FROM dbo.Accomplishment AS a INNER JOIN dbo.AccomplishmentType AS at ON at.Id = a.AccomplishmentTypeId INNER JOIN dbo.AccomplishmentArea AS aal ON aal.AccomplishmentId = a.Id INNER JOIN dbo.Area AS al ON al.Id = aal.AreaId INNER JOIN dbo.UserAccomplishment AS ua ON ua.AccomplishmentId = a.Id INNER JOIN dbo.[User] AS u ON u.Id = ua.UserId INNER JOIN dbo.UserUserGroup AS uug ON uug.UserId = u.Id INNER JOIN dbo.UserGroup AS ug ON ug.Id = uug.UserGroupId INNER JOIN dbo.UserGroupType AS ugt ON ugt.Id = ug.UserGroupTypeId INNER JOIN dbo.UserUserGroup AS uugo ON uugo.UserId = u.Id LEFT OUTER JOIN dbo.UserGroup AS ugo ON ugo.Id = uugo.UserGroupId LEFT OUTER JOIN dbo.UserGroupType AS ugto ON ugto.Id = ugo.UserGroupTypeId WHERE ug.LocalId = 2 AND ugo.LocalId &lt;&gt; 2 AND ugto.LocalId = 4 ORDER BY a.DateCreated DESC, u.LastName, u.FirstName, u.Id, UserGroupName </code></pre> <p>I think this formatting makes it easier to read.</p> <p>Share and enjoy.</p>
    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.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      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