Hi There,

The solution by padders worked beautifully, but there's one thing I don't understand in that DECODE statement:

What does the COUNT(*) part inside the DECODE do, and how does it work? I'd have thought it would need a FROM somewhere, and I can't find any reference to this anywhere.

It's annoying for me that I can use it and it works, but I don't know how.