If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > MySQL > Inserting identical data in multiple rows under one column SQL.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 10-14-05, 06:16
ricoche ricoche is offline
Registered User
 
Join Date: Mar 2005
Posts: 9
Inserting identical data in multiple rows under one column SQL.

Hi there,

Example:

I have a table named "inventory". I have one field which is called "itemID". There are 250 items in the database. I then add a new field which is called "itemDate". I now need to insert 10/12/2005 for each row in the datebase under the "itemDate" column. Doing this 250 times would obviously be a little time consuming.

How would one write this SQL to populate a column with the same data?

Thanks very much.
Reply With Quote
  #2 (permalink)  
Old 10-14-05, 07:35
tombell tombell is offline
Registered User
 
Join Date: Jun 2005
Posts: 23
Code:
UPDATE inventory
 SET itemDate='2005-10-12'
I assume you have declared the itemDate column as date
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On