Hi Everyone,I have to modify the query I wrote. It takes in three args, @loc, @lastName, @group. Here it is:SELECT b.last_name+','+b.first_name as name, *FROM hr.dbo.tbljob aLEFT OUTER JOIN hr.dbo.tblemployee bON a.emplid = b.emplidWHERE a.empl_status = 'A'AND ( a.work_location = @loc AND b.last_name LIKE @loc + '%' AND a.group = @group)ORDER BY b.last_name, b.first_name
Problem is, the three args might not always come in. Perhaps the user wants to perform a search by @loc (location) only.... or maybe @name only, or maybe any 2 of the args or all 3.How do I look out for something like that in SQL? Keep in mind that this is a stored procedure. TIA.