Added support for merging dynamic WHERE with SQL with existing static WHERE