Skip to content
Advertisement

Tag: sql

CSV data to MySQL table

I am trying to insert rows from a csv file into a MySQL table. I tried this code Nb: tab is a table with two columns name (varchar 20) and nb_cases (double) I get this error: DataError: (1265, “Data truncated for column ‘nb_cases’ at row 1”) Answer your number doesn’t fit it must be 983.469 with a point not a

execute delete,sqlalchemy.exc.OperationalError: (sqlite3.OperationalError) near “,”,while i

I want to remove duplicate data from the database, This statement can be executed in navicat. error info: sqlalchemy.exc.OperationalError: (sqlite3.OperationalError) near “,”: syntax error [SQL: ‘delete from Proxy_Main where (Proxy_Main.ip,Proxy_Main.port) in (select ip,port from Proxy_Main group by ip,port having count() > 1) and rowid not in (select min(rowid) from Proxy_Main group by ip,port having count()>1)’] (Background on this error at:

Multithreaded pyodbc connection

I am trying to use a pyodbc connection in multiple threads. I am receieving the following error: Connection is busy with results for another command (0) (SQLExecDirectW)’). I also tried setting MultipleActiveResultSets=yes; and got the same results. I really don’t want to have to create a connection for every thread or query. I also don’t want to use a lock

Join pandas dataframes based on column values

I’m quite new to pandas dataframes, and I’m experiencing some troubles joining two tables. The first df has just 3 columns: DF1: And the second has exactly same two columns (and plenty of others): DF2: What I need is to perform an operation which, in SQL, would look as follows: And, as a result, I want to see DF2, complemented

Function sequence error in PYODBC

I am using pyodbc to connect to a database and extract certain data from it. Here is my code: And I got following error after I run above code: pyodbc.Error: (‘HY010’, ‘[HY010] [Microsoft][ODBC SQL Server Driver]Function sequence error (0) (SQLFetch)’) May I know what caused such problem, and how can I fix it? Thanks. Answer I believe your problem is

Advertisement