-1
我有一個表partywise_account_ledger
列name_of_the_customer
,invoice_date
和invoice_value
。我想根據天數檢索invoice_value
。要獲得< 5 days
值我使用查詢:如何獲取列記錄sql中兩個日期之間的天數
select name_of_the_customer, sum(invoice_value)
from partywise_accounts_ledger
where datediff(d, invoice_date, '2017-04-19') < 5
group by name_of_the_customer
This is the Result of the Query
我怎樣才能獲得< 10 days
列在單獨的語句追加到它,並說明了什麼?
謝謝!
添加一些示例表格數據和預期結果 - 以及格式化文本。 – jarlh
請參閱http://meta.stackoverflow.com/questions/333952/why-should-i-provide-an-mcve-for-what-seems-to-me-to-be-a-very-simple-sql-查詢 – Strawberry