And a last betterer/simpler way to do it.

SELECT if(INSTR(maildir,'+'),concat(left(maildir,instr(maildir,'+')-1),'/Maildir/.',right(maildir,length(maildir)-instr(maildir,'+'))),CONCAT(maildir,'Maildir/')) from mailbox where username ='%s' and active='1'



Reply via email to