Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Returning one column from 2 different tables

Author  Topic 

hasanali00
Posting Yak Master

207 Posts

Posted - 2006-05-12 : 08:52:48
Hi
I wonder if following is possible:

I want to return one column that has data filled in from 2 different tables. For instance, I have:

Products (ProductName (nvarchar 50)
Customers (CustomerName (nvarchar 50)

Now, I want to write a query to return:

ReturnedData:
Product1
product2
customer1
product3
customer2

Is this possible?

Thanks

blindman
Master Smack Fu Yak Hacker

2365 Posts

Posted - 2006-05-12 : 09:25:47
Use a UNION query:

select ProductName from Products as ReturnedData
UNION
select CustomerName from Customers
Go to Top of Page

hasanali00
Posting Yak Master

207 Posts

Posted - 2006-05-12 : 10:07:56
thanks
Go to Top of Page
   

- Advertisement -