Issue-141 updaing SQL query