52
Views
1
Comments
Sql Error
Question

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

2021-05-05 07-35-47
Vera Tiago
Staff

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

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.