SQL CTEs (Common Table Expressions) - Why and How to Use Them

Database Star
Database Star
27.2 هزار بار بازدید - 2 سال پیش - 📝 Get my free SQL
📝 Get my free SQL Cheat Sheets: https://www.databasestar.com/get-sql-...
🎓 Learn and become confident in SQL: https://databasestar.mykajabi.com/sql...

SQL CTEs, or Common Table Expressions, are a helpful feature in SQL. They can help you clean up a query and make it easier to read, and are available in many vendors including Oracle, SQL Server, MySQL, and Postgres.

In this video, you’ll learn what a CTE is, why you would want to use one, see an example of transforming a query to use a CTE, and see the benefits of a CTE.

Timestamps:
00:00 What is a CTE?
01:13 Our sample data
01:51 Create a CTE
04:38 Benefits of using CTEs
06:27 CTE vs Temp Table

Links:
Script on GitHub for sample data and SQL query: https://github.com/bbrumm/databasesta...
2 سال پیش در تاریخ 1401/06/29 منتشر شده است.
27,287 بـار بازدید شده
... بیشتر