Added offset to limit command and add sorting capability
Added example for sorting and window functions