查询出一共两个字段(col1,col2),每个字段都赋值给一个输出参数(out var1,out var2) 这个要怎么写
一个参数我可以这样写的var=col1 from tbl where id=100;两个不可能这样写吧var1=col1,var2=col2 from tbl where id=100;
说能教我一下
谢谢

解决方案 »

  1.   

    var1:=col1,var2:=col2 from tbl where id=100; 
      

  2.   

    mysql下这样是可以的:
    select col1,col2 into var1,var2 from tbl where id=100; 
      

  3.   


    postgresql没有这写法,包括var=col1 from tbl where id=100写法和楼上的mysql是一样的
      

  4.   

    select col1 into var1, col2 into var2 from tbl where id=100;
    或者:
    select col1 into var1 from tbl where id=100;
    select col2 into var2 from tbl where id=100;
    postgresSQL使用plsql这样写的