Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
null 値と null 以外の値を含む SQLite データベースの列から、最後の 3 つの値の平均を見つける必要があります。ただし、null 以外の値のみの平均を見つける必要があります。すなわち。列に 3,0,4,0,5,0,10 が含まれている場合、平均を (10+5+4)/3 にする必要があります。誰でも私が使用できるクエリを手伝ってくれますか? Iam は SQLite の新人です。どんな助けでも感謝しますありがとう。
to_order行を取得する順序とcol番号を含む列があると仮定します。
to_order
col
select avg(col) from tbl where col is not null order by to_order desc limit 3;
さらに質問がある場合は、コメントを残してください。