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 |
peace
Constraint Violating Yak Guru
420 Posts |
Posted - 2013-05-03 : 04:31:39
|
how can i select into temp table for with condition?With A1(Column1,column2,column3) As (...... |
|
bandi
Master Smack Fu Yak Hacker
2242 Posts |
Posted - 2013-05-03 : 04:37:45
|
[code];WITH A1(Column1,column2,column3) As( -- Your SELECT statement)SELECT FROM A1WHERE <condition>[/code]--Chandu |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2013-05-03 : 04:43:23
|
not sure i understand it fullyif you want condition to be applied while populating CTE it should be;WITH A1(Column1,column2,column3) As(SELECT ..FROM..WHERE <condition>)SELECT FROM A1 If you want condition to be applied while retrieving from CTE use earlier suggestion------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/https://www.facebook.com/VmBlogs |
|
|
peace
Constraint Violating Yak Guru
420 Posts |
Posted - 2013-05-03 : 04:51:08
|
I meant i need to select the result into temp table.Where should i apply the SELECT INTO #A .... |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2013-05-03 : 04:57:05
|
[code];WITH A1(Column1,column2,column3) As(SELECT ..FROM..)SELECT * INTO #AFROM A1WHERE <condition>[/code]------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/https://www.facebook.com/VmBlogs |
|
|
|
|
|