I'm trying to use sqldf to do a left join on python. Here's my code:
query="select a.*, b.* from df1 as a left join df2 as b on a.name = b.name and a.year<=b.year"
df3=sqldf(query)
Even though df2 has the column 'name' (verified this), I get the following error:
PandaSQLException: (sqlite3.OperationalError) no such column: b.name
[SQL: select a.*, b.* from df1 as a left join df2 as b on a.name = b.name and a.year<=b.year]
(Background on this error at: https://sqlalche.me/e/14/e3q8)
Is there a format to be followed for the column names inside the SQL query? TIA.