Fixed SQL Query condition to append AND