我有以下查询:
$tagCordQuery = $this->freqDb->select()
->from("rr_amplifiers", "*")
->join("amplifiers_coordinate", "amplifiers_coordinate.name = TRIM(TRAILING '0' FROM rr_amplifiers.name)", array())
->where("amplifiers_coordinate.name IN(?)", $apsName);
其中 $apsName 是一个数组。
问题是当这个数组只有一个元素时,查询有额外的括号,如下所示:
SELECT `rr_amplifiers`.* FROM `rr_amplifiers`
INNER JOIN `amplifiers_coordinate` ON amplifiers_coordinate.name = TRIM(TRAILING '0' FROM rr_amplifiers.name) WHERE (amplifiers_coordinate.name IN('xpto'))
为什么会这样?