If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > MySQL > CONNECT BY in MYSQL

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 09-05-08, 04:37
srinath.a srinath.a is offline
Registered User
 
Join Date: Sep 2008
Posts: 11
Question CONNECT BY in MYSQL

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

help me plz !!
thanks,
srinath
Reply With Quote
  #2 (permalink)  
Old 09-05-08, 05:37
r937 r937 is offline
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,525
no, there is not
__________________
r937.com | rudy.ca
please visit Simply SQL and buy my book
Reply With Quote
  #3 (permalink)  
Old 09-05-08, 05:44
srinath.a srinath.a is offline
Registered User
 
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;
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On