Common table expression(CTE) basically used Specifies a temporary named result set, Create a recursive query and Reference the resulting table multiple times in the same statement.
Deleting Duplicate Entry
Finding missing records using CTE function