At 7:27 AM +0000 2/27/08, Thufir wrote:
I'm reading "SQL for dummies" and one of the more interesting sections
was on recursion. The example query was something like:
WITH RECURSIVE
ReachableFrom (Source, Destination)
AS (SELECT Source, Destination
FROM FLIGHT
UNION
SELECT in.Source, out.Destination
FROM ReachableFrom in, FLIGHT out
WHERE in.Destination = out.Source
)
SELECT * FROM ReachableFrom
WHERE Source = "Portland";
I'm a bit thrown by the union. Can this be simplified to:
WITH RECURSIVE
ReachableFrom (Source, Destination)
AS (SELECT Source, Destination
FROM FLIGHT
)
SELECT * FROM ReachableFrom
WHERE Source = "Portland";
MySQL does not have "WITH RECURSIVE".
--
Paul DuBois, MySQL Documentation Team
Madison, Wisconsin, USA
MySQL AB, www.mysql.com
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]