Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Combining 2 like-structured tables together via SELECT

Status
Not open for further replies.

Shrum

Programmer
May 17, 2002
122
US
I have 2 tables that I want to (soft) combine into 1 via a select. The tables are named:

1) dir_updates
2) dir_content_weblog

Both of these tables are structured exactly the same. I want to be able to combine the two of them so I can post the latest `modified` date on my site homepage.

I guess what I'm trying to do is a '2 table into one, non-relational' query. I'm not sure if this is possible but I figured that if it was possible, someone here would know.

TIA


=============================
Sean Shrum
Shrum Consulting
C.A.T.S.: Consulting: Programming: R/C Soaring:
 
i ur version 4.0.0 or baove u can union cluse else above 3.23 u can use temporary table
Code:
create temporary table tmp_tbal type=heap as select * from dir_updates ;
insert into tmp_tbl select * from  dir_content_weblog
if u want pemanent data the remove temporaray



[ponder]
----------------
ur feedback is a very welcome desire
 
and which field do both tables have in common ???
 
tshot, please slow down, it will improve your typing sk1llz0rz

are you doing this from a cell phone? because if you're using a browser, could you please type out "you" instead of "u" -- sorry, that's one of my biggest pet peeves

hos2, the tables probably have all fields in common, in the sense that yes, all the fields are the same, but you won't get anything out of a join because the values are all different

it really does sound like a UNION is desired

sean, if you're not on version 4, see
Writing UNION statements in MySQL 3.x

rudy
SQL Consulting
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top