gap-text2sql icon indicating copy to clipboard operation
gap-text2sql copied to clipboard

The JOIN table part of the output SQL does not contain ON clauses.

Open lanqil opened this issue 4 years ago • 4 comments

Hello, I found the output sql does not contain ON clauses. For example, "question": "Show the stadium name and the number of concerts in each stadium." "predicted": "SELECT stadium.Name, Count() FROM stadium JOIN concert GROUP BY stadium.Stadium_ID" "gold": "SELECT T2.name , count() FROM concert AS T1 JOIN stadium AS T2 ON T1.stadium_id = T2.stadium_id GROUP BY T1.stadium_id" I want to know how to get the on clauses "ON T1.stadium_id = T2.stadium_id". Thank you.

lanqil avatar Feb 24 '21 16:02 lanqil

Hi @Impavidity @pnpnpn, I am also facing the same issue. Any suggestions to fix this problem?

awasthiabhijeet avatar Apr 12 '21 10:04 awasthiabhijeet

I'm also facing this issue now..... @Impavidity @pnpnpn Can you give us some help?

xkluan avatar Aug 20 '21 08:08 xkluan

You can get the ON clause by rules based on the structure of the database. For example, the concert table has a foreign key that connect to the primary key of stadium table. Then you can compose concert.stadium_id = stadium.stadium_id.

Impavidity avatar Aug 20 '21 19:08 Impavidity

Hey @Impavidity , I am facing the same issue. How do I execute the solution you just suggested. Can you please elaborate a little.

surajjkumar avatar Dec 22 '21 13:12 surajjkumar