sql 语句如下:
  select *
    from kaohe
    where nian=:nian
    and cast(renyuanid as char(20)) in
    (select cast(renyuanid as char(20))
    from renyuan
    where cast(departmentid as char(20))=(
    select cast(departmentid as char(20))
    from department
    where department=:department))
 这个语句我在sql explore中试过了,如不带参数,没有一点问题,能运行。
但我这样写在程序中却不行。为什么,我后来没有用参数, 直接把参数值加了进去,成功了,不过感觉不爽。为什么会这样呢