I have a relatively complex query, with several self joins, which works on a rather large table. For that query to perform faster, I thus need to only work with a subset of the data.
I\'m trying to select the hierarchy of a product category tree in SQL. My code looks as follows. I\'m trying to achieve a dynamic sort order, using IF or Case When on the SortOrder parameter.
I have the following CTE. Its purpose is to provide unique Month/Year pairs. Later code will use the CTE to produce a concatenated string list of the Month/Year pairs.
I have been working on a query that will return a suggested start date for a manufacturing line based on due date and the number of minutes needed to complete the task.
I have a very simple query that I need pivoted, but I haven\'t got a clue how to turn it into a pivot table from what I\'ve read in the literature.Everything I\'ve read involves hard-coded columns or
I need to generate a list of users that are managers, or managers of managers, for company departments.
How does with clause work in SQL Server? Does it really give me some performance boost or does it just help to make more readable scripts?
I am having extreme difficulty constructing a query which returns an XML style hierarchy. We have a database table which contains a hierarchy of URLs for our website. The table contains the columns:
I have the following schema: ParcelsSegmentsSegmentsParcels ==================================== ParcelIDSegmentIDParcelID
Im looking for some way of extrating data form a tree table as defined below. Table Tree Defined as :-