fix sql function in select column