Solved

SQL query from multiple tables.

Posted on 2008-06-16
2
745 Views
Last Modified: 2010-08-05
Greetings,
I have two views with identical data fields.  I want to select all the data from each and list them sequentially.  For example view1 has data field Order# with values 1,3,5,7.  View2 has Order# with values 2,4,6,8.  Is it possible to have a single select statement that produces a result set as Order# 1,2,3,4,5,6,7,8?  
0
Comment
Question by:mdunlap99
2 Comments
 
LVL 60

Accepted Solution

by:
chapmandew earned 125 total points
ID: 21795679
select * from view1 v1
union all
select * from view2 v2
order by v1.fieldname asc
0
 
LVL 8

Expert Comment

by:i2mental
ID: 21795702
select field1 from table1
union all
select field1 from table 2
order by field1
0

Featured Post

Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

Question has a verified solution.

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

Load balancing is the method of dividing the total amount of work performed by one computer between two or more computers. Its aim is to get more work done in the same amount of time, ensuring that all the users get served faster.
Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
Via a live example, show how to extract information from SQL Server on Database, Connection and Server properties

773 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