【发布时间】:2018-02-09 21:29:13
【问题描述】:
我有 2 个 mysql 表
table1 - 付款
id | client_id | payment | date
1 | 4 | 100 | 01.05.2017
2 | 4 | 120 | 05.05.2017
table2 - 发票
id | client_id | total | invoice_nr | date
1 | 4 | 350 | 0001 | 01.03.2017
2 | 4 | 400 | 0002 | 01.04.2017
如何按日期显示这样的结果
id | date | payment | total | invoice_nr
1 | 01.03.2017 | null | 350 | 0001
2 | 01.04.2017 | null | 400 | 0002
1 | 01.05.2017 | 100 | null | null
2 | 05.05.2017 | 120 | null | null
我尝试了一些方法,但出现了错误。
【问题讨论】:
-
“我在某些方面尝试过,但有错误”您尝试过什么?有什么错误?
-
我们总是乐于帮助和支持新的编码员,但您需要先帮助自己。 :-) 在doing more research 之后,如果您有问题发布您尝试过的方法,并清楚地解释什么不起作用并提供a Minimal, Complete, and Verifiable example。阅读How to Ask 一个好问题。请务必take the tour 并阅读this。