Skip to content
Advertisement

How to write the sql in SQLite with this?

that is from https://www.sqlservercentral.com/articles/hierarchies-on-steroids-1-convert-an-adjacency-list-to-nested-sets. I have tried many ways but not work. The separated cteCountDownlines and join works just fine, but don’t knwo how to conbine them

Advertisement

Answer

If you are using SQLite 3.33.0+ you can use the UPDATE...FROM syntax:

For SQLite 3.15.0+ you can use this syntax:

Note that there is no equivalent to SQL Server’s DATALENGTH() function.
The function LENGTH() I used returns the number of chars in a string.

User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement