Added support for derivated SELECT statements