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.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Need Help

Author  Topic 

kazineel
Starting Member

16 Posts

Posted - 2010-08-02 : 12:54:02
I want to insert value with select statement,
my query like this

INSERT INTO table1 (name, address, status) SELECT name, address FROM table1 where id=32

how to insert status value='R'

webfred
Master Smack Fu Yak Hacker

8781 Posts

Posted - 2010-08-02 : 12:59:32
INSERT INTO table1 (name, address, status) SELECT name, address, 'R' FROM table1 where id=32



No, you're never too old to Yak'n'Roll if you're too young to die.
Go to Top of Page

kazineel
Starting Member

16 Posts

Posted - 2010-08-02 : 13:01:21
quote:
Originally posted by webfred

INSERT INTO table1 (name, address, status) SELECT name, address, 'R' FROM table1 where id=32



No, you're never too old to Yak'n'Roll if you're too young to die.



Thanks Buddy
Go to Top of Page

webfred
Master Smack Fu Yak Hacker

8781 Posts

Posted - 2010-08-02 : 13:03:49
welcome


No, you're never too old to Yak'n'Roll if you're too young to die.
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2010-08-03 : 03:44:46
Why are you inserting data to the same table?

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -