First of all it's quite impossible to say how the query should be modified without the knowledge of the data structures and data you have. So every modification need to be verified.
However there are things to consider. Sub query optimization is just like with any query, you make sure that you have a fast access path to the data. If the amount of data the subquery is fetching is small then you should have proper indexes in place.
For example the
MFS_UTIL_STC_CODE_DESCR
table could have an index containing fields:
- CODE_TYPE
- LANGUAGE_CODE
- CODE_ID
This kind of index would perhaps help to fetch the relevant data in case the amount of data to fetch is small compared to the overall data in the table.
Similarly you should make sure that the table
MFS_AR_COLLECTIVE_BILLING_LINE
has an index on column
COLLECTIVE_BILLING_ID
and so on.
What comes to the query it probably won't execute since there's an extra comma in the end of the field list.
As said without knowing the data it's impossible to say what kind of modifications can be done but you could try modifying the main FROM clause from
FROM dbo.MFS_AR_COLLECTIVE_BILLING AS cb INNER JOIN
dbo.MFS_CUST_CUSTOMER AS cc ON cb.CUSTOMER_ID = cc.CUSTOMER_ID INNER JOIN
(SELECT CODE_DESCR, CODE_ID
FROM dbo.MFS_UTIL_STC_CODE_DESCR
WHERE (CODE_TYPE = 'APPROVAL_STATUS') AND (LANGUAGE_CODE = 'en-US')) AS CodeDesctTemp ON CodeDesctTemp.CODE_ID = cb.APPROVAL_STATUS
to
FROM dbo.MFS_AR_COLLECTIVE_BILLING AS cb
INNER JOIN dbo.MFS_CUST_CUSTOMER AS cc ON cb.CUSTOMER_ID = cc.CUSTOMER_ID
INNER JOIN dbo.MFS_UTIL_STC_CODE_DESCR CodeDesctTemp ON CodeDesctTemp.CODE_ID = cb.APPROVAL_STATUS
WHERE CodeDesctTemp.CODE_TYPE = 'APPROVAL_STATUS'
AND CodeDesctTemp.LANGUAGE_CODE = 'en-US'
That modification could help to remove some complexity from the query, again taken that I've interpreted the conditions correctly.