單項選擇題

假設(shè)Transactions表有AccountID和TransactionDate列,以下哪個SQL語句可以計算每個賬戶在2023年的交易數(shù)量?()

A.SELECT AccountID ,COUNT(*)FROM Transactions WHERE YEAR(TransactionDate)=2023GROUP BY AccountID;
B.SELECT AccountID ,COUNT(TransactionDate)FROM Transactions WHERE TransactionDate BETWEEN ’2023-01-01’AND ’2023-12-31’;
C.SELECT AccountID ,TRANSACTION_COUNT FROM Transactions WHERE YEAR(TransactionDate)=2023;
D.SELECT AccountID ,COUNT(*)FROM Transactions WHERE MONTH(TransactionDate)BETWEEN 1AND 12;

微信掃碼免費搜題