I am trying to pass in the table name for my queries but it doesn't work when I use the code below.
def retrieve_data_single(table_name, date):
conn = psycopg2.connect(host="localhost", port = 5432, database="db", user="user")
cur = conn.cursor()
date = date + "%"
cur.execute("""SELECT open, date FROM table_name WHERE date LIKE (%s)""" , [date])
retrieve_data_single(table_1, '2022-12-12'):