MySQL Forums
Forum List  »  Newbie

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

If I understand it right, it does work IF ALWAYS t2.display_id-t1.display_id = 1.

So, if this is ensured by my program code it would work.:) (Right now, the program code doesn't.)

I've thought of something like

SELECT t1.display_id,t1.fs_path,t2.fs_path as next
FROM playlist_items t1
LEFT JOIN (SELECT fs_path,list_id FROM playlist_items WHERE list_id=123 AND display_id>t1.display_id LIMIT 1) t2
ON t1.list_id = t2.list_id WHERE t1.list_id=123 AND t1.display_id>=12
LIMIT 10;

But I get an

Unknown column 't1.display_id' in 'where clause'



Edited 3 time(s). Last edit at 01/12/2008 04:41PM by Oliver Block.

Options: ReplyQuote


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


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.