Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

display a query from 2 diferent tables

Posted on 2014-04-23
3
Medium Priority
?
136 Views
Last Modified: 2014-04-23
hi all
how do i acomplish
select distinct proveedor from proveedor
select distinct empresa from contactos
in a single query order by proveedor,contactos
is that posible
tsm
edo
0
Comment
Question by:Ernesto
  • 2
3 Comments
 

Author Comment

by:Ernesto
ID: 40018619
i mean in a single order from a to z
tsm
0
 
LVL 11

Accepted Solution

by:
Simone B earned 2000 total points
ID: 40018745
If I'm reading your question correctly, I think this might be what you're looking for. Use whatever you like for "ColumnName."

SELECT distinct proveedor AS ColumnName FROM proveedor
UNION ALL 
SELECT distinct empresa FROM contactos
ORDER BY ColumnName

Open in new window

0
 

Author Closing Comment

by:Ernesto
ID: 40018855
oh man, so nice
0

Featured Post

Get free NFR key for Veeam Availability Suite 9.5

Veeam is happy to provide a free NFR license (1 year, 2 sockets) to all certified IT Pros. The license allows for the non-production use of Veeam Availability Suite v9.5 in your home lab, without any feature limitations. It works for both VMware and Hyper-V environments

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this article we will learn how to fix  “Cannot install SQL Server 2014 Service Pack 2: Unable to install windows installer msi file” error ?
Simulator games are perfect for generating sample realistic data streams, especially for learning data analysis. It is even useful for demoing offerings such as Azure stream analytics, PowerBI etc.
Via a live example combined with referencing Books Online, show some of the information that can be extracted from the Catalog Views in SQL Server.
Via a live example, show how to backup a database, simulate a failure backup the tail of the database transaction log and perform the restore.

927 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question