Results 1 to 3 of 3
  1. #1
    Join Date
    Sep 2008
    Posts
    11

    Question Unanswered: CONNECT BY in MYSQL

    Is there an equivalent of Oracle's
    CONNECT BY in MySQL?

    help me plz !!
    thanks,
    srinath

  2. #2
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    no, there is not
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  3. #3
    Join Date
    Sep 2008
    Posts
    11
    Hi r937,
    can i convert this in to Mysql

    SELECT y.cnt, date_format(y.date_format, '%M %Y') df FROM (SELECT t.cnt, t.date_format FROM TEST t UNION SELECT 0 cnt,x.datum FROM (SELECT ADD_MONTHS(TRUNC(SYSDATE, 'yyyy'), LEVEL - 1) datum FROM dual CONNECT BY LEVEL <= 12) x WHERE datum NOT IN (SELECT date_format FROM TEST)
    AND datum <= (SELECT MAX(date_format) FROM TEST)
    ) y
    ORDER BY y.date_format;

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •