# [SQL] How to retrieve data from two tables?



## smartali89 (Dec 26, 2008)

I have two same tables but using for each for different purpose..

How do I get this data as one table? I don't remember exactly but there is some like a union query... any one knows?

Edit: Nothing to do with Joins.. just want to show merged data


----------



## Deleted member 3 (Dec 26, 2008)

join is really what you need.


----------



## FordGT90Concept (Dec 26, 2008)

Which DB software?  MySQL, Oracle, MS SQL, etc.?


----------



## smartali89 (Dec 26, 2008)

no join.. join will not union columns, which is my requirement..

I am doing it in access


----------



## FordGT90Concept (Dec 27, 2008)

Perhaps this site will help you out:
http://www.fabalou.com/Access/Queries/unionquery.asp


----------



## smartali89 (Dec 27, 2008)

thats what I wanted thanx bro!!


----------



## Deleted member 3 (Dec 27, 2008)

smartali89 said:


> no join.. join will not union columns, which is my requirement..
> 
> I am doing it in access



If you're using Access you dont have to write any SQl yourself in many cases. Just make a query, add two tables and select fields for both. If you wish to make a query via VBA you can always use this method to create the query itself, or at least a sample. Besides, union is a SQL operator as well


----------



## smartali89 (Dec 27, 2008)

yup.. but the query designer won't write the query for this case.. I am using the db in vc#.net 2.0


----------



## Deleted member 3 (Dec 27, 2008)

smartali89 said:


> yup.. but the query designer won't write the query for this case.. I am using the db in vc#.net 2.0



Like I said, you can still use it to write sample queries. When I use Access I become extremely lazy like that. Are you accessing mdb (pre 2007) files or accdb files (2007)? Any idea if there is a difference between accessing either from .NET applications? I do have existing stuff accessing MDB files, would be nice if I can just steal my own code from there to read from an Access 2007 file.


----------



## smartali89 (Dec 27, 2008)

pre 2007... don't think there is any difference in accessing... I haven't used the 2007 db.. I am using pre 2007 in ms access 2007


----------

