私は次のようなクエリを開発しました
select accountname count(transactions)
from table1 group by accountname
where date between '27-mar-2012' and '27-jan-2013'
しかし、演算子間を考慮せずにすべてのトランザクションを提供しています。つまり、1月から12月までのすべての値を考慮しています。私のテーブルには、2012 年 3 月 27 日のような日付列の値が含まれています ...
私が使用する場合
select accountname count(transactions) from table1
group by accountname
where date between cast('27-mar-2012' as date) and cast( '27-jan-2013' as date)
私は間違った結果を得ています。
どうすれば修正できますか?