Quantcast
Channel: Vlad Mihalcea
Viewing all articles
Browse latest Browse all 177

SQL CTE – Common Table Expression

$
0
0

Introduction In this article, we are going to see what an SQL CTE (Common Table Expression) is and how you can use it to reuse subquery result sets or inline views. Database tables Let’s assume we have the following post and post_comment tables that form a one-to-many table relationship: The parent post table contains the following entries: And the post_comment child table contains the following data: SQL CTE (Common Table Expression) We now want to get the first two most-commented posts that start with the SQL prefix along with all their associated... Read More

The post SQL CTE – Common Table Expression appeared first on Vlad Mihalcea.


Viewing all articles
Browse latest Browse all 177

Trending Articles