SQL语句问题
(1)select gdRMJN_ZRZ from Project_SetGDRule_JN where ruleID='1802'显示原来的ZRZ
(2)select PJN_ZRZ,count(PJN_ZRZ) as Frequency from matchHistoryLog where MHL_matchState=1
and ruleID='1802' group by PJN_ZRZ 显示matchHistoryLog表中不同ZRZ出现的次数
要实现在显示matchHistoryLog表中不同ZRZ出现的次数的同时,显示对应的原来的ZRZ,该怎么写?
(3)select b.gdRMJN_ZRZ as PJN_OldKEY,a.PJN_ZRZ as PJN_NEWKEY,count(PJN_ZRZ) as Frequency from matchHistoryLog as a join Project_SetGDRule_JN as b on a.ruleID=b.ruleID and a.ruleID='1802'
and MHL_matchState=1 group by a.PJN_ZRZ,b.gdRMJN_ZRZ 计算的频度与(2)不同,求解释。