Saturday, 12 October 2013

Difference between CTE and View - SQL

             Difference between CTE and View


               A CTE is a temporary/logical View, it is not store physically. It is a named query, the result for which is only available to the very next query after the CTE is defined. CTE is defined using WITH clause.

                  A View is a physical object that is present in the database. View is as good as a Table but it doesn't store data physically as compared to a table, only the data schema is stored in View. View,when referred, pulls data by executing the query that is associated with it.


                 The biggest difference between a CTE and View, is that, View or derived table cannot call itself, whereas CTE can call itself and hence support recursion.


                In many databases, views have options, for instance to index them.

13 comments:

  1. Thank you for posting the valuable information.
    AWS Online Training

    ReplyDelete
  2. Thanks for your informative blog!!! Keep on updating your with such awesome information.
    D365 Finance and Operations Online Training

    ReplyDelete

  3. Thank you for your post. This is excellent information. It is amazing and wonderful to visit your site.This idea is mind blowing. I think everyone should know such information like you have described on this post. Thank you for sharing this explanation
    oracle training in chennai

    oracle training institute in chennai

    oracle training in bangalore

    oracle training in hyderabad

    oracle training

    oracle online training

    hadoop training in chennai

    hadoop training in bangalore

    ReplyDelete
  4. Very Nice Blog…Thanks for sharing this information with us. Here am sharing some information about training institute.
    tektutes tableautraining

    ReplyDelete
  5. This post is so interactive and informative. keep update more information...
    devops training institutes in hyderabad

    ReplyDelete