You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-- SQL queryset @temp=0;
select cnt into @temp from tst ORDER BY cnt DESCLIMIT1;
Update tst set cnt=@temp+100where id in(10);
// Go code for parsing the SQL query
sql :="set @temp=0;select cnt into @temp from tst ORDER BY cnt DESC LIMIT 1;Update tst set cnt=@temp+100 where id in(10);"
p :=parser.New()
stmtNodes, _, err :=p.Parse(sql, "", "")
if err != nil {
fmt.Println("Error parsing SQL:", err)
return
}
for _, stmtNode := range stmtNodes {
fmt.Println("Parsed statement:", stmtNode.Text())
}
Error parsing SQL: line1 column 27 near "into @temp from tst ORDER BY cnt DESC LIMIT 1;Update tst set cnt=@temp+100 where id in(10);"-- SQL for creating database tableCREATETABLE `tst` (
`id`int(10) DEFAULT NULL,
`cnt`int(10) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
The text was updated successfully, but these errors were encountered:
Feature Request
SQL Query
The text was updated successfully, but these errors were encountered: