开发者

Wildcard asterisk character ("*") in SQL database

开发者 https://www.devze.com 2023-02-14 17:18 出处:网络
Can we use the asterisk character * for a 开发者_C百科search action in SQL database? MASQLComm = New SqlCommand(\"SELECT COUNT(*) AS [RecCount]

Can we use the asterisk character * for a 开发者_C百科search action in SQL database?

MASQLComm = New SqlCommand("SELECT COUNT(*) AS [RecCount] 
                              From " & tName & " 
                             WHERE " & tName & fName & " = '" & {*} & ".Temp' ", 
                            SQLConn)

Please advice me with a code for this.


For text you need LIKE with '%'. But make sure you're acquainted with Bobby Tables. http://xkcd.com/327/


Use LIKE operator to do that.

Also I would strongly recommend against building your SQL query like that. Do it if there is no other way.

0

精彩评论

暂无评论...
验证码 换一张
取 消