Does SQLite support character range with [ ]?

qalis

I'm trying to use Northwind version in SQLite (someone posted it on Github and it's super handy), but my query for selecting employees with last name starting with B, C, D, ..., L using LIKE returns empty table:

SELECT Title
FROM Employees
WHERE LastName LIKE '[B-L]%'

The table contains such names (most of them, in fact). Does SQLite not support character range in LIKE with []?

forpas

SQLite does not support this SQL Server - like functionallity that you want.
You can do it with SUBSTR():

WHERE SUBSTR(LastName, 1, 1) BETWEEN 'B' AND 'L'

or:

WHERE LastName >= 'B' AND LastName < 'M'

この記事はインターネットから収集されたものであり、転載の際にはソースを示してください。

侵害の場合は、連絡してください[email protected]

編集
0

コメントを追加

0

関連記事