By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,963 Members | 1,249 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,963 IT Pros & Developers. It's quick & easy.

New Table to contain records from two queries

P: 7
Hello,

What I want to do is as follows
I have Table1 with 100 records.
Query1 contains 20 reocrds from Table1 which fuifill conditions mentioned in Query1
Query2 contains other 20records from Table1 which fulfills conditions mentioned in Query2
Records in Query1 and Query2 will always be different.
Now I want to combine Query1 & Query2 as new Table2
Table2 will now contain 20+20 = 40 records.
Some more records will be added to Table2 and used for generating further queries.


How to go about this.

Please help me.
May 6 '07 #1
Share this Question
Share on Google+
2 Replies


Expert 100+
P: 344
Hello,

What I want to do is as follows
I have Table1 with 100 records.
Query1 contains 20 reocrds from Table1 which fuifill conditions mentioned in Query1
Query2 contains other 20records from Table1 which fulfills conditions mentioned in Query2
Records in Query1 and Query2 will always be different.
Now I want to combine Query1 & Query2 as new Table2
Table2 will now contain 20+20 = 40 records.
Some more records will be added to Table2 and used for generating further queries.


How to go about this.

Please help me.

You can put more than 1 set of conditions in a query, so your query1 could select all records where this AND that AND other are met, then on the second row, put the other set of conditions. Records will be returned that meet all the conditions in row1 OR all the conditions in row2.

If this is not possible then try this

Make a new query, qunQuery3 which is a union query of 1 and 2

i.e. select * from query1 union select * from query2;

Then finally make a maketable query that selects all from qunQuery3 and creates table2.
May 6 '07 #2

P: 7
Thanks for help. I will try both options.
May 6 '07 #3

Post your reply

Sign in to post your reply or Sign up for a free account.