common-table-expression
SQL Server Recursion select
I have two tables: entreprises(id, name) entreprises_struct(id,entreprise_id, entreprise_child_id) let\'s say i have these data:[详细]
2023-02-12 01:16 分类:问答Query for missing elements
I have a table with the following structure: timestamp | name | value 0| john | 5 1| NULL | 3 8| NULL | 12[详细]
2023-02-11 18:27 分类:问答Help with Improving Performance of SQL Server 2008 CTE
I have a SQL Server 2008 CTE which is responsible for returning the Top Review for a location. The CTE is wrapped in a UDF (Table-Valued), and joined on the LocationId field, so i can get the top rev[详细]
2023-02-11 08:51 分类:问答casting error using recursive CTE
I am trying to generate a list of numbers from -1 to 1 in .1 increments. The following is code is giving me an error:[详细]
2023-02-08 14:38 分类:问答Need to convert a recursive CTE query to an index friendly query
After going through all the hard work of writing a recursive CTE query to meet my needs, I realize I can\'t use it because it doesn\'t work in an indexed view.So I need something else to replace the C[详细]
2023-02-07 04:53 分类:问答When to use Common Table Expression (CTE)
I have begun reading about Common Table Expression and cannot think of a use case where I would need to use them. They would seem to be redundant as the same can be done with derived tables. Is there[详细]
2023-02-06 03:40 分类:问答How can I combine CTEs with a FOR XML clause?
I\'m trying to generate some XML with various levels of nesting, and at the risk of over-simplifying, the output XML will be loosely of the format:[详细]
2023-02-04 12:14 分类:问答Common Table Expression Error
I have to use old school ADODB (not ADO.NET) to execute a statement that contains a Common Table Expression.[详细]
2023-02-03 14:11 分类:问答Project data from flat table to Adjacency List
I am designing a system to record and report on daily measurement data.The data consists of a category identifier, the date/time, and the measurement data (of which there can be up to 500 pieces eithe[详细]
2023-02-03 08:03 分类:问答Hierarchical CTE with additional sort column per level
CTEs are a bit new to me so I am hoping someone can help with the following one which I wrote that will take a category table and build a hierarchy out of it for display.I know this kind of thing is a[详细]
2023-02-01 14:08 分类:问答