Jump to content

Insert using select and values


monkeyx

Recommended Posts

Can anyone let me know if it possible to formulate an insert query
that that can use both select and values, so that I can get certain
data from the another table and have fixed values for some of the
fields in the insert query?

I guess one way would be to do an insert for select statement, then an
update for fixed values.

If it is possible will someone please post an example.

Thanks,

monkeyx
Link to comment
Share on other sites

You can create some thing like this:

ex: you have table A with nameA and you wanna insert into nameB table B

Select concat("insert nameB into B values", nameA) From A;
it will print insert stmts for all available values and you can then run the result it in batch mode;

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

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

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  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...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.