我有一個名爲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 –