有人可以幫助我將以下代碼轉換爲原始SQL語句嗎?將WHERE邏輯轉換爲SQL語句
(而不是動態SQL)
Dim blnAllow as Boolean = True
Dim intType as Int32 = 35
.Append("SELECT * FROM TABLE1 WHERE NAME='AAA' ")
Select Case intType
Case 35
.Append("AND (Type IN (2,4) OR type=8) ")
.Append("AND [use]=1 ")
Case 34
If blnAllow = True Then
.Append("AND (Type IN (2,4) OR (type=8 and Col1 > 0)) ")
Else
.Append("AND (Type IN (2,4)) ")
End If
.Append(" AND [use]=1 ")
Case Else
.Append("AND Type=1")
End Select
謝謝!幾乎每個人都明白它的主要想法就像真實性所說的那樣。 – someonewhowillnotbemiss 2011-06-10 06:02:36