gpt4 book ai didi

使用sqlite3查询时MySQL语法错误

转载 作者:行者123 更新时间:2023-11-29 21:42:37 26 4
gpt4 key购买 nike

我只是想从 sqlite3 切换到使用 MySQL,但我在此查询中遇到错误:

SELECT 
metapp_notif.id,
name,
age,
place,
note,
metapp_notif.lat,
metapp_notif.longt,
haslatlong,
dati,
ntype,
grpm_id,
image,
send_id,
pro.latitude,
pro.longtitude,
metapp_notif.dati,
metapp_notif.activity
FROM (metapp_notif
join (metapp_profil
join metapp_userlocation
ON metapp_profil.user_id = metapp_userlocation.user_id) AS pro
ON metapp_notif.send_id = pro.user_id)
WHERE metapp_notif.rec_id =% d;

我收到此错误:

ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'pro on metapp_notif.send_id=pro.user_id) where metapp_notif.rec_id=2' at line 1

我正在寻找 sqlite3 和 mysql 之间的差异,但无法找出问题所在。

提前致谢!

最佳答案

Mysql 中尝试此语法

SELECT metapp_notif.id, 
name,
age,
place,
note,
metapp_notif.lat,
metapp_notif.longt,
haslatlong,
dati,
ntype,
grpm_id,
image,
send_id,
latitude,
longtitude,
metapp_notif.dati,
metapp_notif.activity
FROM metapp_profil
join metapp_notif
ON metapp_notif.send_id = metapp_profil.user_id
join metapp_userlocation
ON metapp_profil.user_id = metapp_userlocation.user_id
WHERE metapp_notif.rec_id like '% d'; -- Not sure what you are trying to do here

关于使用sqlite3查询时MySQL语法错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34377353/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com