SQLite Forum


3 forum posts by user jz1280

11:36 Reply: INNER JOIN error (artifact: fefbb0ddd8 user: jz1280)

Hi and thanks to everyone for the interest.

Keith, I tried you suggestion which ran without a problem from the CLI but throws an error when run from SQLite Studio and also when I tried to run it from the Python interface. Also the output when run from the CLI was suspect, possibly for one of the reasons you described.

In the mean time I have followed Larry's advise and gone back to the documentation. My latest attempt at this query is:

sqlite> UPDATE activity_overview ...> SET 'D3' = 1 ...> FROM activity_overview INNER JOIN query_projects ON activity_overview."Project ID"= query_projects."Project ID" ...> WHERE activity_overview."Early Start" < query_projects."Planned Start"; Error: ambiguous column name: activity_overview.Early Start sqlite>

Which gets further but unfortunately still throws the above error. I have followed the flow chart documented in 'SQL As Understood By SQLite - Update' but I am obviously still missing something.

At the risk of testing your patience, can anyone give me a further pointer?



16:37 Reply: INNER JOIN error (artifact: c95274c798 user: jz1280)

Hi Richard (and Larry)

Many thanks for your responses.

Your comments on square brackets are noted. I am much more familiar with Access/SQL Server and when the convention worked in SQLite I just stuck with it. I am currently exploring the use of UPDATE FROM and am hopeful that it will give me the result I need. If I get stuck I will come back to the forum



11:32 Post: INNER JOIN error (artifact: e0f7df1976 user: jz1280)


I am a SQLite newbie. Can anyone please tell me why the following query results in the reported error

sqlite> UPDATE [activity_overview] INNER JOIN [query_projects] ON [activity_overview].[Project ID] = [query_projects].[Project ID] SET [activity_overview].[C3] = 1 WHERE [query_projects].[Planned Start]) > [activity_overview].[Early Start] ...> ; Error: near "INNER": syntax error sqlite>

The same query works on other SQL systems such as MS Access.

Thanks in anticipation of your help