correct resulting sql request