select * from a where uin in (select uin from b where date = '2010-08-18'); select * from a
select uin from b where date = '2010-08-18'都有结果
提示:
ERROR 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 'select uin from b where date = '2010-08-18')'
这个不是sql的标准语法么,网上搜了下也是这样写啊

解决方案 »

  1.   

    select * from a where uin in (select uin from b where `date`='2010-08-18'); 
      

  2.   

    select * from a where uin in(select uin from b where `date`='2010-08-18');
      

  3.   

    请问啥意思,在date加‘’,这样是干嘛呢??
      

  4.   

    可是我加了''报错啊而且单独执行子查询select uin from b where date = '2010-08-18'是正确的改成select * from a where uin in (select uin from b where uin= 13590146666); 还是报错啊,uin不是关键字哦
      

  5.   

    是``,非'',提示什么,MYSQL什么版本,是否支持子查询
      

  6.   

    版本:mysql  Ver 12.22 Distrib 4.0.27, for unknown-linux-gnu (x86_64)
    不知道是否支持子查询哦     但是in不是标准sql么
      

  7.   

    MYSQL4.1支持子查询
    升级吧
      

  8.   

    谢了楼上的热心回答
    操了,狗日的mysql,