Hi,
I have two tables, for instance,
Table 1
======
id_1 / title_1 / date_1
-------------------------
1 / A / xxx
2 / B / xxx
Table 2
======
id_2 / title_2 / date_2
-------------------------
1 / C / xxx
2 / D / xxx
How can make make the query so that I can have this result that it is i sorted by date,
id / title / date
-------------------------
1 / A / xxx
2 / C / xxx
1 / B / xxx
2 / D / xxx
Is it possible?
I tried to JOIN or to LEFT JOIN them, but it won't get the result I am looking for, is there any other SQL syntax I can try??
Many thanks,
Lau
MYSQL: Concat two tables
Moderator: General Moderators
-
lauthiamkok
- Forum Contributor
- Posts: 153
- Joined: Wed Apr 01, 2009 2:23 pm
- Location: Plymouth, United Kingdom
Re: MYSQL: Concat two tables
Why do you have two tables?
- AbraCadaver
- DevNet Master
- Posts: 2572
- Joined: Mon Feb 24, 2003 10:12 am
- Location: The Republic of Texas
- Contact:
Re: MYSQL: Concat two tables
mysql_function(): WARNING: This extension is deprecated as of PHP 5.5.0, and will be removed in the future. Instead, the MySQLi or PDO_MySQLextension should be used. See also MySQL: choosing an API guide and related FAQ for more information.
-
lauthiamkok
- Forum Contributor
- Posts: 153
- Joined: Wed Apr 01, 2009 2:23 pm
- Location: Plymouth, United Kingdom
Re: MYSQL: Concat two tables
thanks for the reply. yes - union - is what i need.
sorry for not replying you guys earlier cos was not notified.
thanks!
sorry for not replying you guys earlier cos was not notified.
thanks!