select id from familychildren where id in (select id from familypersons where familyid=01)这个SQL有问题吗???怎么总是报错

解决方案 »

  1.   

    我在SQLserver查询分析器里分析了你的语句,刚开始把你的SQL语句复制粘上去时的确有错,但我把"familypersons where" 这个地方的空格消掉后再重新敲上空格后就可以了.所以问题就可能出在这里,你检查一下吧.
      

  2.   

    應該是輸入法的問題 你的Where前面的空格是不是全角輸入的啊?
      

  3.   

    select id from familychildren where id in (select id from familypersons where familyid='01')
      

  4.   

    楼主,是报这样的错误吗?服务器: 消息 170,级别 15,状态 1,行 1
    第 1 行: ' ' 附近有语法错误。同意二楼的观点,将 “familypersons where ”中间的空格去掉,再重新敲个Space,就OK了!
    因为楼主用的是全角的空格键敲的,且T-SQL语法中不把 where 作为关键字来处理了!
      

  5.   

    rs.open 这个SQL的时候老是告诉我 参数不正确我发现就是这个SQL有问题,但是想不出是什么问题
      

  6.   

    familyid=01应该是字符型吧select id from familychildren where id in (select id from familypersons where familyid='01')
      

  7.   

    这样  Data1.recordset.recordsource = "Seelct * Form 学生表 Where [姓名] = '某某'"
      

  8.   

    where familyid='01'01要用''号。