0
如何從基於激勵ID和收件人ID的兌換表中獲取「計數」並將其添加到以下查詢中。基於兩個ID獲取計數
SELECT recipient.*, incentive.*
FROM recipient
INNER JOIN incentive ON recipient.incentiveID=incentive.incentiveID
WHERE recipient.mobile = :mobile
AND recipient.incentiveID = :incentiveID"
下面的查詢會返回收件人和激勵數據。我想對此進行擴展並對收件人兌換次數進行「計數」。即redeemCount
贖回表看起來像這樣,由incentiveID鏈接,recipientID
RedeemedID incentiveID recipientID timestamp
你正在使用哪些DBMS? MySQL或MS SQL Server? –