Re: SQL: Using COALESCE in subquery

yes, coalesce can be used in subquery but it was not suggested, Use coalesce in subqueries will not use the indexs.so you may first normalize your data before run the queries, and insert the normalized data into temporary tables, then run you query, it will help much

As for nullif . i heard there are little difference. In fact , NULLIF and coalesce just like macro.so don't pay more attention to it Regards:-)