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 |
Ajit.Rawat3
Starting Member
4 Posts |
Posted - 2013-04-28 : 01:56:28
|
How to update values in single column with where conditions.For example:table emp: with columns name: ID, ename, join_date1 Abhijeet 2 Baljeet 3 Charanjeet I want to insert/update values in 'join_date' column for all the three rows in single query. |
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2013-04-28 : 02:19:55
|
[code]update eset join_date = '2013-04-28'from empno ewhere . . .[/code] KH[spoiler]Time is always against us[/spoiler] |
|
|
Ajit.Rawat3
Starting Member
4 Posts |
Posted - 2013-04-28 : 23:17:34
|
Thanks for the reply friend but I need to insert multiple values in the column with single query. |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2013-04-29 : 00:21:35
|
quote: Originally posted by Ajit.Rawat3 Thanks for the reply friend but I need to insert multiple values in the column with single query.
multiple values? SO what should be values you need to insert? the field says join_date so we would have expected it to contain single value which will correspond to joining date of employeeor do you mean you need different values in the field for different rows? if yes, explain where you'll get those values from------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/https://www.facebook.com/VmBlogs |
|
|
Ajit.Rawat3
Starting Member
4 Posts |
Posted - 2013-04-29 : 22:50:27
|
let take join_date is an empty column and I want to insert/update value for each cell of that column, how can I do it in one go (in a single query)hope my question is clear to you. and thanks for looking into it |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2013-04-30 : 03:55:24
|
you can use an update as suggested but question is where will you get list of values that needs to be updated------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/https://www.facebook.com/VmBlogs |
|
|
|
|
|