0
ZF2內加入其它時間戳ZF2內加入其它時間戳
大家好,我想檢測poitive邊緣在大數據庫與Zend框架2(ZF2)。 在MySQL它的工作原理與此命令:
SELECT Ta1.datetime, Ta1.SensorId_47, Ta0.SensorId_47
FROM data_newobjects Ta1
INNER JOIN data_newobjects Ta0
ON Ta1.datetime = Ta0.datetime + SECOND(10)
WHERE (Ta1.SensorId_47 LIKE "1%" AND Ta0.SensorId_47 LIKE "0%");
但我怎麼能加入像這裏ZF2的「+ SECOND(10)」下一個時間戳?
它的工作原理,如果我在ZF2上的同一時刻加入:
$sm = $this->getServiceLocator();
$sql =new Sql($sm->get('adapter_rohdata'));
$exp_Text = "`Ta_1`.`datetime` AS `summe`";
$select = $sql->select();
$select->columns(array(new Expression($exp_Text)));
$select->from(array('Ta_1' => 'data_newObjects'));
$select->join(array('Ta_0' => 'data_newObjects'), 'Ta_1.datetime=Ta_0.datetime', array(), \Zend\Db\Sql\Select::JOIN_INNER);
$select->where->like('Ta_0.SensorId_47', "0%");
$select->where->like('Ta_1.SensorId_47', "1%");
$statement = $sql->prepareStatementForSqlObject($select);
$results = $statement->execute();
但我沒有找到一個解決方案,爲「下一個」時間戳,就像它在MySQL的工作,例如與"Ta1.datetime = Ta0.datetime + SECOND(10)"
感謝您的幫助...我真的搜索的幫助,並tryed很多...