我有一个名为fileName的键值为org.eclipse.jgit/src/org/eclipse/jgit/internal/ketch/ProposalRound.java和I想要在fileName与%/ src%匹配时返回一个布尔值。查询看起来像返回一个布尔值,如果它们中至少有一个匹配MYSQL中的正则表达式
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
我要添加其返回1或0的另一字段,如果文件中的至少一个以%/ SRC /%匹配
提前致谢!
检查https://dev.mysql.com/doc/refman/5.7/en/regexp.html –