Fixed 'my account' sql query