Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7601535
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T23:11:13+00:00 2026-05-30T23:11:13+00:00

Is it possible to insert from a list of values from within in mysql?

  • 0

Is it possible to insert from a list of values from within in mysql?

INSERT INTO changes(uid,typ)
SELECT owner,(SELECT * FROM(20,30,40)) lst
FROM info

To put it another way, can you make a list of values act like the result a sub query?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T23:11:15+00:00Added an answer on May 30, 2026 at 11:11 pm

    Actually, what you’re trying to do is sintactically and semantically incorrect 🙂 You’re trying to return 3 rows from a select and put them into the outer select which just accepts one single value (1 column x 1 row).

    Besides there is no way for MySQL to know to which user correponds each number, right? Then, if you had a way to link a user in the inner select to the outer select then you would have two tables and you would join them.

    Now if you are actually looking to join each owner to each of the numbers you’re looking for a cartesian product. And you can do it like this:

    select owner from info, (select 20 union select 30 union select 40) t2
    

    This way, we’re creating a dummy table with 3 records and each of those records we’re linking them to the owner, this would result in:

    owner1 | 20
    owner1 | 30
    owner1 | 40
    owner2 | 20
    owner2 | 30
    owner2 | 40
    owner3 | 20
    

    And so on. Is it clear?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is it possible to do something like this: INSERT INTO table(col1, col2) VALUES(something_from_another_table, value);
Possible Duplicate: syntax for COPY in postgresql INSERT INTO contacts_lists (contact_id, list_id) SELECT contact_id,
Is it possible to insert a row, but only if one of the values
Is it possible to insert a button into a word document and call as
Is it possible to insert multiple sets of values to a SQLite table in
Is it possible to INSERT...ON DUPLICATE KEY UPDATE into a table on the current
Is it possible to insert into a table variable without defining the schema? I
Is it possible to insert information into the gridview's pager, like Showing 10 of
is it possible to insert an object into a session instead of creating a
I am attempting to insert a mass of records into SQL Server 2005 from

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.