我有一个名为fileName的键,其值为org.eclipse.jgit / src / org / eclipse / jgit / internal / ketch / ProposalRound.java,如果fileName与%/ src%匹配,我想返回一个布尔值。查询看起来像
SELECT p.id, p_userName,
COUNT(f.id) as NoOfFilesModified,
sum(f.f_linesInserted) as linesInserted,
sum(f.f_linesDeleted) as linesDeleted
FROM t_change as c, t_file as f, t_revision as r, t_people as p
WHERE f.f_revisionId = r.id
AND r.rev_changeId = c.id
AND c.ch_authorAccountId = p.id
GROUP BY p.id, p.p_userName;
结果以
获得id p_userName NoOfFilesModified linesInserted linesDeleted
1 spearce 2190 50102 20117
2 HudsonVoter 397 14272 494
我想添加另一个字段,如果至少有一个文件与%/ src /%匹配,则返回1或0
提前致谢!
答案 0 :(得分:0)
尝试使用子查询,如
$set = ['online_time' => "(online_time + $t)"];
$where = 'ID = '. $id;
$this->db->update('users', $set, $where);
或
EXISTS(SELECT 1 FROM t_file WHERE f.f_revisionId = r.id AND f.filename REGEXP 'src')