這些是我傳遞一些方法變量,我需要寫一些SQL查詢像SQL查詢,以避免空值參數
string cmd = @"select *
from students_tbl
where
[email protected] and branch_id=in(+" branchId "+)
and passout_year>[email protected]
and current_backlog>[email protected]
and [email protected]
and eGap<[email protected]
and first_year_percent>[email protected]
and second_year_percent>[email protected]
and third_year_percent>[email protected]";
等,但問題是很少有這些參數都是可選的手段對於那些變量 有值爲空,所以我並不想在查詢 所以這些參數,我應該如何消除這些空可變我沒有得到我應該怎麼寫查詢來解決這個問題
這些參數都是隨機的沒有任何修復,當他們將是空的,因爲嘿是可選 所以我應該如何使用只寫入空參數來編寫查詢
那些paameter是隨機沒有修復,當他們將爲空 – NoviceToDotNet 2010-08-16 13:28:25