SELECT A.*,IFNULL(B.QuestionCount,0) AS QuestionCount
FROM RB_Question_Bank AS A LEFT JOIN( SELECT BankId,COUNT(1) AS QuestionCount FROM rb_question WHERE `Status`=0 GROUP BY BankId) AS B ON A.BankId=B.BankId
WHERE 1=1");
FROM RB_Question_Bank AS A LEFT JOIN (SELECT BankId,COUNT(1) AS QuestionCount FROM rb_question WHERE `Status`=0 GROUP BY BankId) AS B ON A.BankId=B.BankId
WHERE 1=1");
builder.AppendFormat(" AND A.{0}={1} ",nameof(RB_Question_Bank_ViewModel.Status),(int)DateStateEnum.Normal);
if(query==null)
{
...
...
@@ -47,7 +47,7 @@ WHERE 1=1");
builder.AppendFormat(" AND A.{0} LIKE @BankName ",nameof(RB_Question_Bank_ViewModel.BankName));