select top 15 * from EQUIP where FQBH = 123 and sbbh not in (select top 10 * from EQUIP where FQBH = 123)
ERROR [http-80-4] - [Microsoft][SQLServer 2000 Driver for JDBC][SQLServer]当没有用 EXISTS 引入子查询时,在选择列表中只能指定一个表达式。
ERROR [http-80-4] - error
org.hibernate.exception.GenericJDBCException: could not execute query
这个语句是用来查询 EQUIP  表中 FQBH = 123 的第11条到第15记录的,请大家帮忙看看哪错了

解决方案 »

  1.   

    select top 10 * from EQUIP where FQBH = 123)中不能用*必须是具体的字段sbbh 
      

  2.   

    select top 15 * from EQUIP where FQBH = 123 and sbbh not in (select top 10 sbbh  from EQUIP where FQBH = 123)
      

  3.   

    select top 15 * from EQUIP where FQBH = 123 and sbbh not in (select top 10 * from EQUIP where FQBH = 123)
    sbbh not in (查询);中查询的结果必须是一个字段并且必须是FQBH中的sbbh字段
      

  4.   

    select top 15 * from EQUIP where FQBH = 123 and sbbh not in (select top 10 sbbh from EQUIP where FQBH = 123)
      

  5.   

    select top 15 * from EQUIP where FQBH = 123 and sbbh not in (select top 10 sbbh from EQUIP where FQBH = 123)你子查询中返回的字段不唯一
      

  6.   

    select top 15 * from EQUIP where FQBH = 123 and sbbh not in (select top 10 sbbh from EQUIP where FQBH = 123)
      

  7.   

    select top 15 * from EQUIP where FQBH = 123 and sbbh not in (select top 10 sbbh from EQUIP where FQBH = 123) 这里不能使用*。只能出现一个字段。
      

  8.   

    学习了!子查询的字段唯一要注意!特别是not in 等一些关键词!
      

  9.   

    子查询返回的列表时多值的,而你指定了在子查询结果中寻找sbbh字段,当然不正确,让你的子查询返回列表只有唯一值就行了