1
我想要顯示具有多個條件的條件,但是如果任何條件爲空或者沒有任何值而不是如何在where子句中設置。 例子:如何在Sql中的Where子句中設置條件
where
SR.fk_Designation_ID = @pk_Designation_ID
and SR.fk_SeniorityCategory_ID = @pk_SeniorityCategory_ID
and SR.IsCurrent_Appointment = 1 and SR.fk_SeparationType_ID is null
order by Senority_Joining_For_Order,E.Date_Of_Birth
這裏如果@pk_SeniorityCategory_ID
是null
比我不想包括where
子句and SR.fk_SeniorityCategory_ID = @pk_SeniorityCategory_ID
條件。
嘿Ivan_83 ....多謝....它的工作... :) –
我很高興我能幫助:) –