我尝试编写代码以找到最接近的值但是我的代码有一些syntex错误请帮助
您的SQL语法有错误;检查与MySQL服务器版本对应的手册,以便在第7行的''附近使用正确的语法
update member t1
set Latid = (
select id
from markersphuket t2
where t2.MU = t1.Moo
order by abs(t2.hno2 - t1.Hno2)
limit 1
答案 0 :(得分:2)
尝试:
update member t1
set Latid = (
select id
from markersphuket t2
where t2.MU = t1.Moo
order by abs(t2.hno2 - t1.Hno2)
limit 1 )
WHERE 1 // will update all the rows of member table
答案 1 :(得分:0)
尝试:
update member t1
set Latid = (
select id
from markersphuket t2
where t2.MU = t1.Moo
order by abs(t2.hno2 - t1.Hno2)
)
limit 1
答案 2 :(得分:0)
你错过了最后一次)
吗?
update member t1
set Latid = (
select id
from markersphuket t2
where t2.MU = t1.Moo
order by abs(t2.hno2 - t1.Hno2)
limit 1
)