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 |
nizguy
Starting Member
37 Posts |
Posted - 2011-07-06 : 14:24:13
|
Hello All, I need your help.Here is my query:INSERT INTO Zipcode_new (Zip, Vendor_id, Delivery_Agent)SELECT z.zip, z.Dlry_Vendor z.Dlry.VendorFROM Zipcode zWHERE Zip between '90012' and '95999'The result from this query:90012 1263 126390013 1263 126390014 1263 126390015 1263 1263But I want the second value hard coded to 1000, not from the select result, how can I do thatI want the result look like this90012 1000 126390013 1000 126390014 1000 126390015 1000 1263Thank you |
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2011-07-06 : 14:27:26
|
INSERT INTO Zipcode_new (Zip, Vendor_id, Delivery_Agent)SELECT z.zip,1000, z.Dlry.VendorFROMZipcode zWHEREZip between '90012' and '95999'------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
nizguy
Starting Member
37 Posts |
Posted - 2011-07-06 : 14:32:48
|
That's all. what a dump questionBut I tried something similar and it gave me an errorthank you |
 |
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2011-07-06 : 14:35:14
|
you were missing a comma too in your posted code. may be thats the reason------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
|
|
|