Query the statement of mysql2 tables. at the end of this post, table A & nbsp; id & nbsp; & nbsp.
This post was last edited by dxmbxh6 at 14:14:55
Table
Id time title
1 2014-05-01 aaaaaaaaaaaa
2 2014-05-02 bbbbbbbbbbbbbbb
3
Table B
Id time url
1 2014-05-03 cccccccccccccccccccccccc
2 2014-05-04 ddddddddddddddddddddddd
3 2014-05-05 eeeeeeeeeeeeeeeeeee
4 2014-05-06 fffffffffffffffffffffffffffffffffffffffff
Expected results
Type id date title
A 1 2014-05-01 aaaaaaaaaaaa
B 1 2014-05-03 cccccccccccccccccccccccc
B 2 2014-05-04 ddddddddddddddddddddddd
B 3 2014-05-05 eeeeeeeeeeeeeeeeeee
------ Solution --------------------
This table is designed to be problematic. Unable to implement
------ Solution --------------------
The type field of the result does not exist in both tables. Where does it come from?
------ Solution --------------------
select 'a' as tname , id, time , title from a
union all
select 'b' as tname , id , time ,url from b
order by 2,1
------ Solution --------------------
I don't see any details
Why do Table a's id = 2 and Table B's id = 4 remember to divide it?