切莫意气用事青铜三
2023-3-26 16:35:07 发布在问答
数据集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上运行是正常的,在永洪上就行了,谁能解答一下吗?


1403
1
精彩评论1
yhdata_yzm
发表于 2023-3-27 09:24:14 显示全部楼层
sql写的不对呢,或者是你连接的数据驱动的关系
回复

使用道具 2#

高级模式
您需要登录后才可以回帖 登录 | 免费注册

  • 官方微信

    欢迎关注永洪服务号!收费为0,价值无限

    扫码关注
  • 新浪微博

    让每位用户轻松挖掘数据价值!

    访问新浪微博
  • 智能客服
1500W

用户等你来哦

Copyright   ©2012-2025  北京永洪商智科技有限公司  (京ICP备12050607) 京公网安备110110802011451号 |《永洪社区协议》
返回顶部