Replace sql call by algorithm
take all other field but use the sql function