mysql quot,MySQL错误"空字符串作为参数!字符”

I have a very simple query

select *

from tablename

where keyvar is not null

order by keyvar

The query worked before but for some reason now I am getting an error:

Error:Error formatting SQL query: empty string given as argument for ! character

Anyone has any idea why I am getting this error? Any help hugely appreciated

PS: If I run the whole code again from scratch (creating the database, loading the csv file etc) the query works fine.

解决方案

First of all, this is not a MySQL error - it's a MySQL Workbench error (you can see it in Oracle's source code here).

Secondly, you'll get this error when no database is selected. There's two ways you can select one.

Let's look at what it looks like when no databases are selected:

LkRm0.png

as you can see it's not bold. This can be easily fixed by double clicking on the database name, or right clicking and choosing "Set as Default Schema":

8OJwR.png

BHPNP.png

Should you still not see any database selected on the left side, you can force it by using the SQL command USE like so: USE `dbname`; (where dbname is your database name):

1cP6L.png

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值