CASE in WHERE, SQL Server

前端 未结 5 1846
南笙
南笙 2020-12-06 04:47

I\'m doing some search, where users are choosing in dropdown some clauses. When they leave some box empty, I want query to ignore clause. I know CASE, and best I thought of

5条回答
  •  没有蜡笔的小新
    2020-12-06 05:12

    (something else) should be a.Country

    if Country is nullable then make(something else) be a.Country OR a.Country is NULL

提交回复
热议问题