defog-ai / sqlcoder

SoTA LLM for converting natural language questions to SQL queries
Apache License 2.0
3.17k stars 198 forks source link

Sql not applicable to Mysql or ODPS #109

Open aso233 opened 1 month ago

aso233 commented 1 month ago

The generated SQL statement is not applicable to MySQL or ODPS if it contains statements with functions such as date_trunc, date_part, and CURRENT_DATE. These seem to be PostgreSQL functions.

Is there any way to generate SQL statements for a specific database type in the model?

aso233 commented 1 month ago

I have tried to prompt the model like this:

The generated SQL statement must follow the MySQL syntax specification. Do not use method like: date_trunc、date_part、CURRENT_DATE

But it doesn't works.

JennieGao-njust commented 1 month ago

I have tried to prompt the model like this:

The generated SQL statement must follow the MySQL syntax specification. Do not use method like: date_trunc、date_part、CURRENT_DATE

But it doesn't works. I encountered the same problem, have you solved it?

FaizelK commented 2 weeks ago

@aso233 we have been asking from 2023 but I think the guys are not focused on opensource anymore, see this link I am refering to

https://github.com/defog-ai/sqlcoder/issues/11