On 3 feb 2006, at 14.06, Nigel Bishop wrote:
Thank you very much, that did the business
This should generate the same plan as the previous query, but be a little bit more clean and easy to read:
SELECT sendto FROM users t1 WHERE domain='rusty.com' ANDusername = COALESCE((SELECT username FROM users WHERE username='fred' and domain=t1.domain), username);
Sincerely, Niklas Johansson ---------------------------(end of broadcast)--------------------------- TIP 2: Don't 'kill -9' the postmaster