title: Not able to apply join in sql query
body: <p>i want to add the join <strong>"JOIN {User}
  ON {Deck}.[CreatedBy] = {User}.[Id]"</strong> in following query. I tried many combination but not succeeded. i want to fetch Name from User table </p>
  
  <pre><code>    SELECT  @CampaignQueryFilterString AS [Selected],
      {Deck}.[Id], {Deck}.[Name],
      {User}.[Name],
      {Deck}.[TableOfContentId], {Deck}.[CreatedBy],
      {Deck}.[LastModifiedOn], {Deck}.[ExpiryDate],s1.[Count]      
      FROM  {Deck}
      JOIN
      (
          SELECT {Deck}.[Id],
          LISTAGG( {TagValue}.[Id], ',' ) WITHIN GROUP (ORDER BY {TagValue}.[TagCategoryId] ) AS Tags
          FROM {Deck} 
          JOIN {AssociatedDeckTags}
          ON {AssociatedDeckTags}.[DeckId] = {Deck}.[Id]
          JOIN {TagValue}
          ON {AssociatedDeckTags}.[TagValueId] = {TagValue}.[Id]
          WHERE {Deck}.[IsPublished] = 1
                  AND {Deck}.[IsActive] = 1 AND {Deck}.[ReplacedByDeckId] IS NULL
                  AND {Deck}.[TableOfContentId] IN @TableOfContentIdFilterString
                  AND {Deck}.[ContentFileTypeId] IN @AllowedContentType
                  AND {Deck}.[ExpiryDate] &gt; SYSDATE
          GROUP BY {Deck}.[Id]       
      ) DeckView
      ON {Deck}.[Id] = DeckView.Id  
      JOIN(
          SELECT COUNT(*) AS [Count], {DeckGroup}.[DeckId] AS [S1DeckId]
          FROM {DeckGroup}
          JOIN {Slide} ON {Slide}.[DeckGroupId] = {DeckGroup}.[Id]
          GROUP BY {DeckGroup}.[DeckId]
      ) s1 ON s1.[S1DeckId] = {Deck}.[Id]
      @RegexString
      @SearchFilter
      @CreatedBy
      GROUP BY 
      {Deck}.[Id], {Deck}.[Name], {Deck}.[TableOfContentId], 
      {Deck}.[CreatedOn], {Deck}.[CreatedBy],
      {Deck}.[LastModifiedOn], {Deck}.[ExpiryDate], 
      {Deck}.[NumOfPreviews], {Deck}.[NumOfDownloads],s1.[Count]        
      ORDER BY @Orderby
  </code></pre>