Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
n1coltsfan
Starting Member
2 Posts |
Posted - 2008-04-29 : 14:35:46
|
How do I save my query results into new table.... The ORIGINAL COLUMN Of course before parsing--- But the only data I want is in the three no name columns---(NO Column Name),(NO Column Name),(NO Column Name)I don’t want the original column saved back but I think it existing in the final query is blocking my Insert Into--- |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
Posted - 2008-04-29 : 14:37:28
|
| Your problem is not clear. Please provide a data example of what you mean.Tara KizerMicrosoft MVP for Windows Server System - SQL Serverhttp://weblogs.sqlteam.com/tarad/ |
 |
|
|
eilert
Starting Member
3 Posts |
Posted - 2008-04-29 : 21:29:17
|
| I'm not exactly sure what you're trying to accomplish, but if you are inserting into a new table, you can use the SELECT INTO syntax. You'll also have to alias any columns that are calculated in any way... For example:SELECTSUM(col1) AS col1,AVG(col2) AS col2,CASE WHEN col3 = 1 THEN 'A' ELSE 'B' END AS col3INTO tblNewFROM tblOldof coarse you'd need a group by clause if you were aggregating some columns but not others, but those are just examples of when you'd need to alias columns. |
 |
|
|
|
|
|