开发者

SQLite Params and wildcards

I'm trying to query like this...

SELECT * FROM Urls
WHERE Urls.url LIKE '%' + 'sports' + '%'

The above returns no records, whereas the following does return records.

SELECT * FROM Urls
WHERE Urls.url LIKE '%sports%'

The reason why I want to use the first example is because I'd like to replace 'sports' with a param but when I so so I get no records returned.

开发者_如何学CANSWER:

I just Googled 'sqlite +concatenation' :)

SELECT * FROM Urls
WHERE Urls.url LIKE '%' || 'sports' || '%'
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜