Is it possible to streamline this query?

Hi,

I have this awful query that I would like to streamline, and add a where clause.
Any ideas?

SELECT *
FROM
table1
Where (firstout Between #MonthStart# and #MonthEnd#)
UNION all

SELECT *
FROM
table2
Where (firstout Between #MonthStart# and #MonthEnd#)
UNION ALL

SELECT *
FROM
table3
Where (firstout Between #MonthStart# and #MonthEnd#)

order by pk
LVL 1
g118481Asked:
Who is Participating?
 
Tacobell777Commented:
I'm not sure how you can streamline this query even more?
You already have a where clause for each query in the union.. What more do you want?
0
 
mrichmonCommented:
well in order to answer this question you will have to tell us what is included in the * in each table.... and how the tables are related.

It would also help to know what kind of data you are pulling.
0
 
g118481Author Commented:
The tables are not really related, but they do have the same field names.  The data is simple calendar data.
0
 
mrichmonCommented:
Then I don't think you can do any more if they are not related.

You will be forced to have a union per table if there is no other relation between the tables.
0
 
Tacobell777Commented:
exactly..
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.