mysql - Search in a table based on multiple column value -
i have table, want filter data of table based on multiple column value whether type value of 1 column or more one.
i using code.
alter proc usp_getdata @name varchar(50)= null , @sector int =null,` `@pocket varchar(50) =null , @plot int =null , @locality varchar(50) =null select * m_details v_regname =@name , n_sector =@sector , v_pocket=@pocket , n_plotno=@plot , v_locality=@locality
i want replace column value @name not null therefore result.
in procedure, replace bits v_regname =@name
with
(@name null or v_regname = @name)
Comments
Post a Comment