0

I have a feeling this is a simple error, but I do not know what I am doing wrong! I have one table in sqlite3 that has 33 fields, called "users" and want to import data for 7 of the fields from another table.

Here is what I am doing:

INSERT INTO users(id, username, password, firstName, lastName, email, membershipStart) SELECT(id, username, password, nicename, displayname, email, registered) FROM tempUSERS;

And then I get:

Error: near ",": syntax error

What is wrong with what I am doing?? -Raymosrunerx

1 Answer 1

1

You don't need the parens in the select:

INSERT INTO users(id, username, password, firstName, lastName, email, membershipStart)
    SELECT id, username, password, nicename, displayname, email, registered
    FROM tempUSERS;

When the SQL parser encounters parentheses, it is expecting a scalar expression or subquery. Your expression is clearly not a subquery, and commas are not appropriate in a scalar expression.

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.