Added row number sql functionality.