标题: 数据集SQL报错是什么原因? [打印本页] 作者: 切莫意气用事 时间: 2023-3-26 16:35 标题: 数据集SQL报错是什么原因? MySQL数据库,sql语句如下:
select
GSH
,GSMC
,BBBJ
,concat_ws('-',WPLX,WPMC,GG,WPXL,DJP) as sort_field1
,concat_ws('-',WPLX,WPMC,GG,WPXL,DJP,BBBJ) as sort_field2
,(case
when @rank_col1 = concat_ws('-',WPLX,WPMC,GG,WPXL,DJP)
then
case when BBBJ < @min_num then @min_num := BBBJ
else @min_num end
else @min_num := BBBJ
end) as ttt2
,@rank_col1 := concat_ws('-',WPLX,WPMC,GG,WPXL,DJP)
from jtpm_bid_anomaly_rt,(select @min_num := 1,@rank_col1 := '') AS B
where flag = '1' and wpxl = '68D/24F' and wpmc = 'FDY半消光' and gg = '73dtex/24F'
order by sort_field1 desc,bbbj asc
运行时报错:
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 'min_num THEN @min_num := BBBJ ELSE @min_num END ELSE @min_num := BBBJ ' at line 7
搞不懂,在Navicat上运行是正常的,在永洪上就行了,谁能解答一下吗?