检查与您的mysql服务器版本对应的手册 [英] check the manual that corresponds to your mysql server version

查看:1550
本文介绍了检查与您的mysql服务器版本对应的手册的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在运行程序时遇到此异常。



您的SQL语法错误;查看与您的MySQL服务器版本对应的手册,以便在第1行的'leave on users.Id = leave.UserId'附近使用正确的语法



string query =SELECT * FROM users INNER JOIN leave on users.Id = leave.UserId;



这是查询

如何解决这个问题请给出解决方案。

I am getting this Exception When I run the Program.

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 'leave on users.Id=leave.UserId' at line 1

string query = "SELECT *FROM users INNER JOIN leave on users.Id = leave.UserId";

this is the Query
How to resolve this problem please give solution.

推荐答案

尝试转义表和列的名称。也许leave是mysql中的关键字:

Try escaping the names of tables and columns. Perhaps leave is a keyword in mysql:
SELECT * FROM `users` INNER JOIN `leave` on `users`.`Id` = `leave`.`UserId`


这篇关于检查与您的mysql服务器版本对应的手册的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆