It has been closed. In your code you are using a derived table inside another derived table but you seem to have forgotten to mention an alias for your inner derived table. Content reproduced on this site is the property of the respective copyright holders.