Top "Recursive-query" questions

The ability to run recursive queries in SQL

How to create a MySQL hierarchical recursive query

I have a MySQL table which is as follows: id | name | parent_id 19 | category1 | 0 20 | category2 | 19 21 | category3 | 20 22 | category4 | 21 ...... Now, I want …

mysql sql hierarchical-data recursive-query
Error - "UNION operator must have an equal number of expressions" when using CTE for recursive selection

At this moment I have a table tblLocation with columns ID, Location, PartOfID. The table is recursively connected to itself: …

sql sql-server tsql recursive-query
How to do the Recursive SELECT query in MySQL?

I got a following table: col1 | col2 | col3 -----+------+------- 1 | a | 5 5 | d | 3 3 | k | 7 6 | o | 2 2 | 0 | 8 If a user searches for "1", …

mysql sql query-optimization recursive-query
MySQL how to fill missing dates in range?

I have a table with 2 columns, date and score. It has at most 30 entries, for each of the last 30 days …

mysql sql recursive-query gaps-and-islands date-arithmetic
Multiple CTE in single query

Is it possible to combine multiple CTEs in single query with arel? I am looking for way to get result …

sql postgresql common-table-expression recursive-query arel
What is the equivalent PostgreSQL syntax to Oracle's CONNECT BY ... START WITH?

In Oracle, if I have a table defined as … CREATE TABLE taxonomy ( key NUMBER(11) NOT NULL CONSTRAINT taxPkey PRIMARY KEY, …

sql oracle postgresql recursive-query connect-by
How to grep a word inside xml files in a folder

I know I can use grep to find a word in all the files present in a folder like this …

regex linux grep recursive-query
MySQL Recursive get all child from parent

i have this case using recursive query on Mysql to find lv 2 and lv3 child on one table... database structure …

mysql hierarchy hierarchical-data recursive-query
How to get all children of a parent and then their children using recursion in query

I have structure like this: <Unit> <SubUnit1> <SubSubUnit1/> <SubSubUnit2/> ... <SubSubUnitN/> &…

sql-server-2008 tree recursive-query
SQL Server Equivalent of Oracle 'CONNECT BY PRIOR', and 'ORDER SIBLINGS BY'

I've got this Oracle code structure I'm trying to convert to SQL Server 2008 (Note: I have used generic names, enclosed …

sql-server oracle recursive-query siblings connect-by