Skip to content
Advertisement

Inserting tuple into postegresql with python – Select statment

Hello I am trying to insert to a pgadmin table using python, I used execute and it worked, but for my second aprt i need to use a fucntion, I got everything working except the inserts with select, it tells my syntax error, or forgot comma, literally everything. Im new, so help would be apprecitated .

JavaScript

Error

JavaScript

Advertisement

Answer

You need to properly use subqueries (google it!). Try something like this, it might work (and please fix your variable names, qwertyu is not good, should be descriptive like unique_id, uname, dname, first_name, etc.)

JavaScript
User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement