I am trying to pull SQL data in python through the read_sql_query().
To pull the data, i am using the below SQL query:
SELECT * FROM table WHERE id IN (:ids);
before these steps, the previous code generates a list of ids in the form of a dataframe. This dataframe can have only 1 id or more than 1000 ids as well.
After searching elsewhere, I can save the df in the form of tuples and then save the query as string with the tuples. I found this solution here: How to pass a data frame as parameter to a SQL query in Python?
But this only works if the df has less than 1000 records.
How to run this so as to include something like 1800 ids.