为什么此查询失败?
SELECT
SUB_COMMODITY,
`VOL` AS Sales,
`VOL_CHANGE` AS Dollar_change,
`VOL_SHARE` AS Dollar_share,
`VOL_SHARE_CHANGE` AS Dollar_share_change,
`U_VOL` AS Unit_sales,
`UVOL_CHANGE` AS Unit_change,
`UVOL_SHARE` AS Unit_share,
`UVOL_SHARE_CHANGE` AS Unit_share_change,
`VOL_MKT_SHARE` AS Market_share,
`PERIOD`
FROM `calculatedsummary`
WHERE WEEK = 52
AND PERIOD BETWEEN '2012-03-01' AND '2012-03-31'
AND MKT = '000 Total Market'
AND COMMODITY = 'CONDIMENTS SAUCES'
AND SUB_COMMODITY = 'BBQ SAUCE'
AND BRAND_FAMILY_DESC = 'Total'
AND session_id = 'ADBCDEFGHIJQLMNOPQRSTUVWXYZ'
MySQL服务器日志:
并且还得到#2013错误 - 在查询期间与MySQL服务器的连接丢失
但如果我改变
session_id ='ADBCDEFGHIJQLMNOPQRSTUVWXYZ'
要
session_id LIKE'%ADBCDEFGHIJQLMNOPQRSTUVWXYZ%'
答案 0 :(得分:0)
我解决了这个问题,
显然我使用过的表有超过50个字段设置为VARCHAR 255而且太大了,所以通过将字段大小减小到准确的大小,问题就解决了。