因为数据库版本问题,不支持子查询!请高手帮我用旧版本支持的代码实现以下查询:
select * from hotkey p , t_cosler c where CONV(HEX(left(CONVERT(name USING gbk),1)),16,10) between c.cBegin and c.cEnd and c.f_PY='N')麻烦高手帮帮我,非常谢谢! 

解决方案 »

  1.   

    1、可以用VIEW OR 直接生成表来过渡;
    2、你的查询没有子查询嘛 
      

  2.   


    这段代码在mysql 5.0查询是成功的,但在目前我的数据库mysql4.0.21里查询不成功,显示版本问题?如下:#1064 - 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 'USING gbk ) , 1 ) ) , 16 , 10 ) between c . cBegin and c . cEnd 
    请问这是什么原因?
      

  3.   

    请教别人说不是子查询问题,而是数据库字符集不支持GBK的原因?
      

  4.   

    CONVERT(expr USING transcoding_name)  这个用法要到4.1.0以后的版本才支持。