I am following salesforce's documentation here and trying to formulate a soql query for datacategories related to knowledge articles of type knowledge as follows:
SELECT Id, title (SELECT Id FROM DataCategorySelections) from Knowledge__kav where PublishStatus = 'Online'
I also tried adding the language (just in case), however, I keep getting an unknown error parsing query
I tried using the developer console, this is not critical or affecting me in any way, I just wanted to display id`s, titles and the datacategory associated to the articles. Is the documentation incorrect? or am I missing something? I would have thought that this being part of the documentation, under the module that introduces users to using SOSL and SOQL the example would work,
the first example works fine:
SELECT Id,ParentId FROM knowledge__DataCategorySelection
Additionally, if i run this:
string soql =('SELECT Id, title (SELECT Id FROM DataCategorySelections) from
Knowledge__kav where PublishStatus = \'Online\'');
List<sObject> sobjList = Database.query(soql);
system.debug(sobjList);
I get a Fatal Error:
EXCEPTION_THROWN [2]|System.QueryException: unexpected token: 'SELECT' FATAL_ERROR System.QueryException: unexpected token: 'SELECT' FATAL_ERROR AnonymousBlock: line 2, column 1
which leads me to believe that the documentation is inaccurate...