Sql Error

  

SyntaxEditor Code Snippet

Select (SELECT {COUGGroup}.[GroupName],count({COUGUserMapping}.[UserId]),count({COUGDeckMapping}.[DeckId]),{COUGUserMapping}.[IsActive]=True
From {COUGGroup}
LEFT JOIN {COUGUserMapping}
 on {COUGGroup}.[Id]={COUGUserMapping}.[COUGGroupId]
LEFT JOIN {COUGDeckMapping}
 on {COUGGroup}.[Id]={COUGDeckMapping}.[COUGGroupId]) 
 Where {COUGUserMapping}.[Id] 
 IN
 (
 Select {COUGUserMapping}.[Id] from {COUGUserMapping} where USERID=24
 )
 Group by {COUGUserMapping}.[COUGGroupId]

i am getting the error in this.

I want that the outer query have the exact ids present in inner query.


I am getting the following error

ORA-00923 FROM KEYWORD not found where expected

Hi Lovish,

You have 

where USERID=24

on your filter clause. Shouldn't be something like 

{COUGUserMapping}.[UserId]=24

?
Also, be very careful with this hardcoded IDs, because once you change your app to another environment this ID may be different.

Vera