Top "Common-table-expression" questions

A Common Table Expression (CTE) is a temporary result set that is defined within the execution scope of a single SELECT, INSERT, UPDATE, DELETE, or CREATE VIEW statement.

Guidance on using the WITH clause in SQL

I understand how to use the WITH clause for recursive queries (!!), but I'm having problems understanding its general use / power. …

sql postgresql sql-update common-table-expression
SQLITE Query results into a temp table

I haven't used SQLite before and can't figure out the syntax, I have this working in SQL Server if it …

sqlite common-table-expression create-table
SQL Server: How to limit CTE recursion to rows just recursivly added?

Simpler Example Let's try a simpler example, so people can wrap their heads around the concepts, and have a practical …

sql-server common-table-expression
How to transform a MSSQL CTE query to MySQL?

in my MySQL schema, I have the category(id, parentid, name) table In the MSSQL, I have that CTE query (…

mysql sql-server common-table-expression adjacency-list
Call a Stored procedure in SQL CTE

Are you allowed to exec stored procedures within a SQL CTE statement? I'm a bit new to sql cte queries...

sql sql-server-2005 common-table-expression
Difference between WITH clause and subquery?

What is the difference between WITH clause and subquery? 1. WITH table_name as ( ... ) 2. select * from ( select curr from tableone t1 …

sql oracle subquery common-table-expression
UNION ALL in CTE

I'm trying to get a UNION ALL working with a CTE which I'm using for paging. I need to get …

sql sql-server-2008 sql-server-2008-r2 common-table-expression union-all
Hierarchical data in Linq - options and performance

I have some hierarchical data - each entry has an id and a (nullable) parent entry id. I want to …

sql linq sql-server-2005 c#-3.0 common-table-expression
SQL - CTE vs VIEW

My question here is what is the difference between CTE and View in SQL. I mean in which case I …

sql sql-server common-table-expression sql-view