我有兩個表名稱的收入和支出。我想要連接兩個表並獲取兩個日期範圍值之間的數據。如何加入兩個表之間的條件
Income
=============
id income_name income_price income_date
1 admission 30 2017-10-10
2 hostel 40 2017-10-9
3 bus 50 2017-10-7
expenses
=============
id expenses_name expenses_price expenses_date
1 furniture 30 2017-10-9
2 teacher 40 2017-10-8
3 bus 60 2017-10-7
我想從日期2017-10-6到2017-10-10之間的兩個表中檢索數據。請幫助我。 結果表
=============
id income_name income_price expense_name expenses_price
1 admission 30 furniture 30
2 hostel 40 teacher 40
3 bus 50 bus 60
您可能需要聯合而不是聯接,但從您的問題中不清楚。也許你可以添加你的預期結果? –
家庭作業問題需要努力尋求幫助。你嘗試過什麼嗎? –
這可以幫助你:https://www.w3schools.com/sql/sql_join.asp你是指聯合兩張表嗎? – Ryosaku