1

I am trying to insert a row into a table called "all_games" using SQLite. I have the values "game" and "money" where game is an integer and money is a string, however the middle value "players" is the value that I don't have, so I want to get it from another table that contains it.

This is the SQL Query that I am currently using:

INSERT INTO all_games (game, ... , money)
    SELECT (12, players, \'100, 200\') FROM games WHERE id=2

Just to clarify, "12" and "100, 200" represent values that I already have, I just want to get players from another table.

Thanks for any help in advance!

1 Answer 1

1

I believe you just need to remove the second set of parentheses.

INSERT INTO all_games (game, players , money)
    SELECT 12, players, '100, 200' FROM games WHERE id=2
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.