Can we pass parameters to a view in SQL?

前端 未结 20 2374
庸人自扰
庸人自扰 2020-11-29 18:29

Can we pass a parameter to a view in Microsoft SQL Server?

I tried to create view in the following way, but it doesn\'t work:

create o         


        
20条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-11-29 18:58

    Why do you need a parameter in view? You might just use WHERE clause.

    create view v_emp as select * from emp ;
    

    and your query should do the job:

    select * from v_emp where emp_id=&eno;
    

提交回复
热议问题