AT TIME ZONE (Transact-SQL)

Converts an inputdate to the corresponding datetimeoffset value in the target time zone. When inputdate is provided without offset information, the function applies the offset of the time zone assuming that inputdate is in the target time zone. If inputdate is provided as a datetimeoffset value, then AT TIME ZONE clause converts it into the target time zone using the time zone conversion rules. AT TIME ZONE implementation relies on... » read more

UNION vs UNION ALL

UNION The UNION command combines the result set of two or more SELECT statements (only distinct values). UNION ALL The UNION ALL command combines the result set of two or more SELECT statements (allows duplicate values).