Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Copying rows into the same table 1

Status
Not open for further replies.

Lladros

Programmer
Feb 21, 2008
18
US
Hi All!

I am trying to copy multiple rows from a table into the same table. However, one of the field values needs to change in the insert. This is what I have so far.

INSERT INTO MODULE(MODULE_TITLE,MODULE_DESC,MODULE_INSTRUCTOR,MODULE_SCHLYR ) SELECT MODULE_TITLE, MODULE_DESC, MODULE_INSTRUCTOR FROM MODULE WHERE MODULE_SCHLYR='2008'

The column MODULE_SCHLYR field value needs to be 2009. Does anyone know how I can accomplish this?

Thank you in advance.
 
Code:
INSERT INTO MODULE(MODULE_TITLE,MODULE_DESC,MODULE_INSTRUCTOR,MODULE_SCHLYR ) 
SELECT MODULE_TITLE, MODULE_DESC, MODULE_INSTRUCTOR, '2009' FROM MODULE WHERE MODULE_SCHLYR='2008'

"NOTHING is more important in a database than integrity." ESquared
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top