troubleshooting Question

Can I append a table with all fields from another table.

Avatar of molar
molarFlag for United Kingdom of Great Britain and Northern Ireland asked on
Microsoft SQL Server
5 Comments2 Solutions647 ViewsLast Modified:
I have two tables with the same column. The second was created using select * into <tableb> from <tablea> where amount x > y dollars

I would like to append tableb with another set of information from table a with another condition (ie colx > const y).  I can't just compound it intot the same where statement as the result sets are not mutually exclusive

eg for an item in the table worth 10000 dollars, it would be selected on a filter for >1000 and >5000 dollars, so it should appear twice in table b.

One way might be to use inserts but there's a lot of columns, and the column list changes fairly frequently so I don't want to have to specify each column individually.

Is there a simpler way of appending the data from several queries in a single table?
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 2 Answers and 5 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 2 Answers and 5 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros