有两个MySQL表:
table1
id | time | status
-----------------------
1 | 10:00 | conn |
1 | 10:01 | disconn |
2 | 10:02 | conn |
2 | 10:03 | disconn |
3 | 10:04 | conn |
table2
id | time |
------------
3 | 10:05 |
If there is no disconn time value for ceratin id then take it from table2. What is sql query to get wished result:
id | conn | disconn|
--------------------
1 | 10:00| 10:01 |
2 | 10:02| 10:03 |
3 | 10:04| 10:05 |