Skip to content Skip to sidebar Skip to footer
Showing posts with the label Common Table Expression

How To Sort Parents And All Siblings Using Cte For Adjacency List?

This is my table: CREATE TABLE IF NOT EXISTS NODE ( UUID VARCHAR NOT NULL, PARENT_UUID VA… Read more How To Sort Parents And All Siblings Using Cte For Adjacency List?

Sql How To Split Quantity Into Multiple Rows Based On Quantity On Target Source

I have two table where i want to join and show quantity with details. table are join with ITM,DIA ,… Read more Sql How To Split Quantity Into Multiple Rows Based On Quantity On Target Source

Remove Duplicates From A Table And Re-link Referencing Rows To The New Master

I have a table transcription which contains passages of transcribed text and their citations with c… Read more Remove Duplicates From A Table And Re-link Referencing Rows To The New Master

Traverse Through All Foreign Keys In Database And Generate A Path

I wrote a query to find out primary key - foreign key relationship between all the tables in a data… Read more Traverse Through All Foreign Keys In Database And Generate A Path

Using A Cte To Split Results Across A Cross Apply

I have some data that I need to output as rows containing markup tags, which I'm doing inside a… Read more Using A Cte To Split Results Across A Cross Apply

Cte Vs. T-sql Loop For Determining Depth Of Object Hierarchy

I have a table consisting of about 70,000 rows and two columns (both VARCHAR(16)): id and parent_id… Read more Cte Vs. T-sql Loop For Determining Depth Of Object Hierarchy

Insert Into A Temp Table In A Cte

I am trying to insert data into a temp table within a CTE. Here is the Code I am using: Can someo… Read more Insert Into A Temp Table In A Cte

Group By & Sum Of Values With Missing Months

I have gone through a lot of examples and joined couple of them in order to come down to the follow… Read more Group By & Sum Of Values With Missing Months