SQL: fixed bug on LET clause because $current wasn't set