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 |
|
stephenf
Starting Member
1 Post |
Posted - 2010-04-30 : 16:14:53
|
And this thing is driving me batty! I am trying to create a temp table. It is giving me the error: Msg 207, Level 16, State 1, Line 64Invalid column name 'MIN'.andMsg 116, Level 16, State 1, Line 64Only one expression can be specified in the select list when the subquery is not introduced with EXISTS.This is my butchered, probably, code: quote: Insert into ##MyAwesomeTableSelect dbo.a.b, dbo.a.c, dbo.a.d, dbo.a.e, dbo.a.ffrom dbo.awhere dbo.a.f = (Select MIN (dbo.a.e) from dbo.a where dbo.a.TransactionID = '126303')
then following, because I haven't figured out how to get looping going, so a lot of manual coding,: quote: Insert into ##MyAwesomeTableSelect dbo.a.b, dbo.a.c, dbo.a.d, dbo.a.e, dbo.a.ffrom dbo.awhere dbo.a.f = (Select MIN,+1,(dbo.a.e) from dbo.a where dbo.a.TransactionID = '126303')
This continues at least 10 more times, with (Select MIN, +2,( or +3. I am getting the errors above.Any help would be greatly appreciated. Telvez Te Quiero, Pero Primero Es Lo Primero. |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2010-05-01 : 00:53:58
|
| this will return you only those rows which have a.f value equal to minimum a.e for the transaction with id 126303. is this your exact reqmnt?------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
|
|
|
|
|
|