detto così non credo che tu possa farlo.
Al massimo:
$sql="SELECT * FROM Table ";
if(intval($id) > 0) $sql.="WHERE id = ".$id;