WITH studentsM AS (
SELECT * FROM StudentsMaster
)
SELECT * FROM studentsM
if you are looking first time "With" clause in SQL then you will think that here studentsM is a temporary table and in next line "SELECT * FROM studentsM" we are retriving values from temporary table.
BUT ITS NOT CORRECT
In real "With" clause is very useful to improve performance of your query.
How: in our first statement its not crating Temporary table. It just giving name to select query and in second statement we are querying from that Name (above select query) means you need not to create a temporary table you just write any large sql query and give it name using with and later (in next of after next statement) we can query on it... Very Goood no..? It will improve your query Speed very much..