Suppose you have to following tables where a sale consists of products and a product can be placed in multiple categories. Whereby categories have a hierarchy structure like:
I have a question about how MS SQL evaluates functions inside CTEs. A couple of searches didn\'t turn up any results related to this issue, but I apologize if this is common knowledge and I\'m just be
I have a simple weighted graph A 1 / \\\\ 0.5 /\\\\0.5 BC Suppose this describes a family and A is the father, B is the son and C is the mother. Let\'s say B is studying in an university and A ha
I have a very fat common table expression which includes row numbers so that I can return a paged result set. I also want to return the total nu开发者_StackOverflow中文版mber of records that match the
Here\'s a brain-twister for the SQL guys - can anyone think of a reason why the first of these functions performs fine, and the second one runs dog-slow?
I have got simple query WITHconn_cte ( ParentCategoryId, CategoryId, IdsPath ) AS ( SELECT ParentCategoryId
I have a requirement to turn a table into XML with counts for values. e.g. Table Id , Type, AnotherType
I am using a Common Table Expression for paging: with query as ( Select Row_Number() over (Order By OrderNum ASC) as TableRowNum,
DECLARE @UDFLabel1 VARCHAR(50), @UDFLabel2 VARCHAR(50), @UDFLabel3 VARCHAR(50), @UDFLabel4 VARCHAR(50), @UDFLabel5 VARCHAR(50)
With a table of the following structure and sample data: TableActivity ------------- TypeVARCHAR(8) ActivityVARCHAR(8)