SQLite Exact match
Moderator: Rathinagiri
- karweru
- Posts: 220
- Joined: Fri Aug 01, 2008 1:51 pm
- DBs Used: DBF,mysql,mariadb,postgresql,sqlite,odbc
- Contact:
SQLite Exact match
Hi all,
How can one get SQLite to return an exact match from a query,...the equivalent of ‘==‘ ?
How can one get SQLite to return an exact match from a query,...the equivalent of ‘==‘ ?
Kind regards,
Gilbert.
Gilbert.
- dragancesu
- Posts: 925
- Joined: Mon Jun 24, 2013 11:53 am
- DBs Used: DBF, MySQL, Oracle
- Location: Subotica, Serbia
Re: SQLite Exact match
Yes or No, depending what you want
Query result can be number, character or array, big array
If your query result is number or character answer is Yes
otherwise is No
Query result can be number, character or array, big array
If your query result is number or character answer is Yes
otherwise is No
- karweru
- Posts: 220
- Joined: Fri Aug 01, 2008 1:51 pm
- DBs Used: DBF,mysql,mariadb,postgresql,sqlite,odbc
- Contact:
Re: SQLite Exact match
I need for strings,
This query also returns instances where payr_code is capital ‘C’. I need it to only return small ‘c’ instances.
Code: Select all
select account_code from payr where payr_code=‘c’;
Kind regards,
Gilbert.
Gilbert.
- dragancesu
- Posts: 925
- Joined: Mon Jun 24, 2013 11:53 am
- DBs Used: DBF, MySQL, Oracle
- Location: Subotica, Serbia
Re: SQLite Exact match
https://sqlite.org/lang_corefunc.html
see function lower
select lower(account_code) from payr where payr_code=‘c’;
see function lower
select lower(account_code) from payr where payr_code=‘c’;
- karweru
- Posts: 220
- Joined: Fri Aug 01, 2008 1:51 pm
- DBs Used: DBF,mysql,mariadb,postgresql,sqlite,odbc
- Contact:
Re: SQLite Exact match
Thank you dragancesu,
Not exactly what I require. The problem is after WHERE. It would appear the EQUAL operator (=) is case insensitive,...can't find a way to force it to recognize case such that 'C' is not equal to 'c'
Not exactly what I require. The problem is after WHERE. It would appear the EQUAL operator (=) is case insensitive,...can't find a way to force it to recognize case such that 'C' is not equal to 'c'
Kind regards,
Gilbert.
Gilbert.
- dragancesu
- Posts: 925
- Joined: Mon Jun 24, 2013 11:53 am
- DBs Used: DBF, MySQL, Oracle
- Location: Subotica, Serbia
Re: SQLite Exact match
I don't use SQLite but you can find resolve your problem
https://stackoverflow.com/questions/973 ... -comparing
SELECT * FROM ... WHERE name = 'someone' COLLATE NOCASE
https://stackoverflow.com/questions/973 ... -comparing
SELECT * FROM ... WHERE name = 'someone' COLLATE NOCASE
Re: SQLite Exact match
Hello,
select account_code from payr where payr_code like ‘c’; or COLLATE NOCASE
Re: SQLite Exact match
LIKE is no case sensitive
select * from client where name LIKE 'dan'
without the % is ==
the problem is the speed of LIKE
Re: SQLite Exact match
Hi,
I am sure you must have searched in Google for an option. When I searched use of "Glob" function has come up.
Please see discussion here:
https://stackoverflow.com/questions/223 ... -sensitive
Hope that helps.
Warm regards,
Jayadev
I am sure you must have searched in Google for an option. When I searched use of "Glob" function has come up.
Please see discussion here:
https://stackoverflow.com/questions/223 ... -sensitive
Hope that helps.
Warm regards,
Jayadev
- karweru
- Posts: 220
- Joined: Fri Aug 01, 2008 1:51 pm
- DBs Used: DBF,mysql,mariadb,postgresql,sqlite,odbc
- Contact:
Re: SQLite Exact match
Thank you all,
Thank you Jayadev, GLOB works perfectly. Stuff like this makes one really appreciate harbour
Thank you Jayadev, GLOB works perfectly. Stuff like this makes one really appreciate harbour
Kind regards,
Gilbert.
Gilbert.