fixed cust sql