mysql - Selecting data from two tables -


hello question sql commands...

if have 2 tables same number of columns , same fieldnames (e.g: a(n,name,date) , b(n,name,date))

in website, want retrieve data both tables , display them in order date descendent.

(the use of 2 tables due difference in tables database or server,or use of every table.. there's need display both tables in 1 order)

exemple

table sport_news(n_event,title,texte,date) table international_news(n_event,title,texte,date)

display:

  christiano ronaldo ... 2011/25/01         christiano ronaldo 1 of famous...     barack obama president of usa...  2011/24/01           barak obama........    arsenal has... 2011/23/01          chamakh, player of arsenal anger..... 

i hope idea clear : , thank you!

you want union

select a.name,a.date   table1  ...  union select b.name,b.date   table2 b  ... order 2 desc 

when use union, specify order column numbers instead of names.


Comments

Popular posts from this blog

java - SNMP4J General Variable Binding Error -

windows - Python Service Installation - "Could not find PythonClass entry" -

Determine if a XmlNode is empty or null in C#? -