select * from lrk.all_employee where tel is not null and py_name='lxf' and dep in  (select CD_ID from center.b_bz_base)这是SQL语句,但是dep是字符型的,而后面的select CD_ID from center.b_bz_base查出来是数字型的。请问怎么改?

解决方案 »

  1.   


    1
    select * from lrk.all_employee where tel is not null and py_name='lxf' and to_number(dep) in (select CD_ID from center.b_bz_base)
    2
    select * from lrk.all_employee where tel is not null and py_name='lxf' and dep in (select to_char(CD_ID) from center.b_bz_base)
    3
    select * from lrk.all_employee where tel is not null and py_name='lxf' 
    and (dep+0) in (select CD_ID from center.b_bz_base)
      

  2.   


    select * from lrk.all_employee where tel is not null and py_name 'lxf' and dep in (select to_char(cd_id) form c enter.b_bz_base)
      

  3.   

    select * from lrk.all_employee where tel is not null and py_name='lxf' and dep in (select ''||CD_ID||'' from center.b_bz_base)