SQL statement filter result

后端 未结 2 1248
长情又很酷
长情又很酷 2021-01-26 04:04

I need to filter the SQL query result according to 3 conditions:
1. Location
2. Doctor Name
3. Specialty Name

Below is the sql query if all 3 conditions are

2条回答
  •  一整个雨季
    2021-01-26 04:24

    select Location, ...
    from clinicdoctors
    where 
     ISNULL(@Location,Location) = Location
     and ISNULL(@DoctorName,DoctorName) = DoctorName
     and ISNULL(@SpecialtyName,SpecialtyName) = SpecialtyName
    

提交回复
热议问题