简体   繁体   中英

SQL syntax error: near “.”?

When I try to run this query:

UPDATE Line_Master 
SET Line_Master.line_count = t2.task_count FROM (SELECT COUNT (am.line_id) AS task_count, lm.lineId
   FROM Assets_Master am,Line_Master lm,Section_Master sm,Task_Point_Master tpm,Task_Master TM
   WHERE (lm.line_id = am.line_id)
     AND (am.asset_id = sm.asset_id)
     AND (sm.section_id = tpm.section_id)
     AND (tm.task_point_id = tpm.task_point_id)
   GROUP BY lm.line_id) t2
WHERE Line_Master.line_id = t2.lineId

I get this error:

Internal Error syntax error: near ".":Syntax error

I don't know what you are trying to do, but this way the Syntax is correct. But i don't know if it shows your desired result and if sqlite supports this...

UPDATE Line_Master 
SET Line_Master.line_count = (SELECT t2.task_count FROM (SELECT COUNT (am.line_id) AS task_count, lm.lineId
   FROM Assets_Master am,Line_Master lm,Section_Master sm,Task_Point_Master tpm,Task_Master TM
   WHERE (lm.line_id = am.line_id)
     AND (am.asset_id = sm.asset_id)
     AND (sm.section_id = tpm.section_id)
     AND (tm.task_point_id = tpm.task_point_id)
   GROUP BY lm.line_id) t2
   WHERE Line_Master.line_id = t2.lineId)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM