Add clausule where in sql command and a logic table with more than 1 phisical table