Alternate for regexp in sqlite
-
Hi,
I was trying to get the count of id that starts from 712 where id is of 6 digit number. But this fails and always print 0 whereas I tried on db sqlite browser, then it prints 80 whose command mentioned
SELECT COUNT(*) AS RowCnt from testTable where id regexp '712'
Is there any other alternative to perform same operation from qt, if so kindly help me know?
Thanks in advance
-
@dsba said in Alternate for regexp in sqlite:
Is there any other alternative to perform same operation from qt
I don't see why it should not work with Qt. Please show us your code.
-
Hi,
I was trying to get the count of id that starts from 712 where id is of 6 digit number. But this fails and always print 0 whereas I tried on db sqlite browser, then it prints 80 whose command mentioned
SELECT COUNT(*) AS RowCnt from testTable where id regexp '712'
Is there any other alternative to perform same operation from qt, if so kindly help me know?
Thanks in advance
@dsba Why don't you use https://www.w3schools.com/sql/sql_like.asp ?
Should it not be like:SELECT COUNT(*) AS RowCnt from testTable where id regexp '712.*'
?