I use postgresql.
in SQL using two tables: A (date, month, quantity), B (start date, end date)
"select sum (quantity) as total group by month" is the formula
I would like to exclude the quantity between the start and end dates, but
What should I do?
Thank you for your cooperation.
I solved myself.The following SQL works well.
select month, sum (quantity) as total from A where not exists (select * from B where a. date between b. start date and b. end date) group by month
574 rails db:create error: Could not find mysql2-0.5.4 in any of the sources
585 PHP ssh2_scp_send fails to send files as intended
577 Who developed the "avformat-59.dll" that comes with FFmpeg?
579 Understanding How to Configure Google API Key
925 When building Fast API+Uvicorn environment with PyInstaller, console=False results in an error
© 2024 OneMinuteCode. All rights reserved.