T-SQL Tuesday #18 – A Better Solution On May 10, 2011 By John Morehouse My first post for T-SQL Tuesday #18. Here I describe how I used a CTE to solve the need to query multiple tables and return data from only specific ones without having to use ‘IF’ statements.