add subquery in constant