如何在 sql server 2005 中为以下条件编写 if not exists 语句
如果@MeasurementId 说值 (1,2,3) 这些是现有值,则以下语句有效,但是当 @MeasurementId=0 时,它似乎不起作用...
If not exists(select Mat_Id,MeasurementId from MaterialQuantity where
Mat_Id=@Id and MeasurementId=@MeasurementId)
NULL但是,如果列中有值,上述语句似乎不起作用MeasurementId。请注意,您MeasurementId不是这里的外键...
如何分配NULLif@MeasurementId为 0 或@MeasurementId按原样在
where语句中使用...