I have the SQL Server query as follows:
(select class_code from class_code where course_code IN
(select '(' + ltrim(rtrim(course_code)) + ')' from employee where employee_code = 'A'))
In the above query, the subquery
(select '(' + ltrim(rtrim(course_code)) + ')' from employee where employee_code = 'A')
will return the value as ('sdd','sdsd','sdsd') since course_code field in employee table has the value as 'sdd','sdsd','sdsd'.
The above QUERY should return records.
However, it seems the above QUERY fail to recognize the result from the subquery. WHY????
Please help.
Thanks.