Jump to content

Recommended Posts

Posted

the first problem was two different structured databases that I need to copy the info from the table users into another database table user.

 

I managed to copy the whole thing to the new database with a new table named users so I need to convert it to the table user.

User has name Users has fname and lname

How do I go about inserting the fname and lname into another table called sname. Bear in mind that I need a space after fname.

 

I think it would be with the insert command but I can't seem to figure out the proper terms.

 

Any Help will be greatly appreciated.

 

Thanks

Cindy

The Blue Unicorn

Posted

INSERT INTO tablename (fieldname1, fieldname2, fieldname3) VALUES (value1, value2, value3)

 

You can make it shorter if you know the order of your fields in which case you can drop the field names.

Posted

>INSERT INTO User(name) SELECT CONCAT(fname, ' ', lname) AS old_names FROM Users;

 

That's just off the top of my head so there is likely an error or two in it.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...