MySQL Forums
Forum List  »  Newbie

Re: achievable with the means of SQL?
Posted by: Oliver Block
Date: January 12, 2008 06:42PM

Yes, thanks anyway.

BTW: I solved the problem this way:

SET @n=0, @m=0;

SELECT t1.display_id,t1.fs_path,t2.fs_path AS next FROM
(SELECT display_id,list_id,fs_path,(@m:=@m+1) AS num
FROM playlist_items
WHERE list_id=4 AND display_id>=0) t1


LEFT JOIN
(SELECT fs_path, (@n:=@n+1) AS num
FROM playlist_items
WHERE list_id=4 AND display_id>=0) t2

ON t1.num+1=t2.num;

Thanks for pointing to that direction.

Best regards,

Oliver Block



Edited 2 time(s). Last edit at 01/14/2008 07:19AM by Oliver Block.

Options: ReplyQuote


Subject
Written By
Posted
Re: achievable with the means of SQL?
January 12, 2008 06:42PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.