0
0
JPJavier Pacheco
The code reads a SQL statement from the file input. It uses the string concatenation operator (+) to define a list of column identifiers. It then passes that list to the read_sql() function, which will select all the columns from the table named table where the column identifier in the list matches the given identifier.
import pandas as pd
df = pd.read_sql(
"SELECT columns "+
"FROM table "
"WHERE column IN ({})".format(', '.join([str(id) for id in list]))
,dbConnection
)