我又一个数组:array[0] = 张三
              array[1]= 李四
              array[2] = 王二麻子我想去数据库检索,select * from table1 where name =''  只想把名字在我的数组中的数据检索出来。我该如何写?谢谢! 简单问题

解决方案 »

  1.   

    for 循环数组
    select * into 变量 from table1 where name =array。next
      

  2.   

    for 循环数组
    select * into 变量 from table1 where name =  array。next
      

  3.   

    还有中办法 你循环数组
    定义个变量 ss
    for 循环数组
    ss := ss||‘,’||array。next
    select * from table1 where name in(ss)
      

  4.   

    select * from table1 where name ='张三' or name ='李四' or name ='王二麻子' 以上的方法就可以。
      

  5.   

    type t_name_tbl is table of table1%rowtype index by binary_integer;
      

  6.   

    select * into 变量 from table1 where name =  array。next
      

  7.   

    你这个如果只是用简单的sql语句好像不易实现
      

  8.   

    用table函数,具体格式 是:select * from table(fn_tb('张三,李四,王五'))
      

  9.   

    select * from table where name in("张三","李四","王五")