Registered Member
|
Hello,
I'm new on KEXI and SQL. I want to make a match in a query. I have thise query, that work very well : SELECT Column_1, Column_2, Column_3, Column_4, Column_5, Column_7 FROM ipsite WHERE Column_4 = 'Computer12' Now, I want all record with column_4 begining by 'Computer'. I think the best way is a REGEXP. So I try to modify SQL request with some internet help : WHERE Column_4 = 'Computer.*' WHERE Column_4 REGEXP 'Computer.*' WHERE regexp_like(Column_4,'Computer.*') WHERE RLIKE(Column_4 , 'Computer.*' ) etc. But nothing works. More generally, I test functions in https://community.kde.org/Kexi/Plugins/ ... _Functions and some works (random, upper, length) and some don't work (count, sum...). How to know which ones work ? So my question : How to select all 'Computer.*' field ? Thnk |
Moderator
|
Hi Lamomej
Please google for "sqlite like", the LIKE operator is the way to go. So e.g. instead WHERE Column_4 = 'Computer.*' write WHERE Column_4 LIKE 'Computer%' (I am assuming .* is the regular expression, not a dot character and a wild card; please note, the LIKE operator is more like a wildcard, so it's limited) We really shall add support for a REGEXP operator since even Sqlite supports it. Feel free to report a wish on bugs.kde.org. As always it's not a matter of adding a simple call - we need to check diferences between all three db engines we officially support, and possibly remove differences. |
Registered Member
|
Thank you, it's work. It's clearly a very limited REGEXP...
Maybe you can add a verbatim escape for SQL requests, like an advanced mode. In charge to user to use it with intelligence (like LateX macro in Lyx, compiler option in codeblock or assembler code in C source). |
Moderator
|
Agreed, that's always good too have feature. It's a wish reported at https://bugs.kde.org/show_bug.cgi?id=298149, feel free to vote |
Registered users: Bing [Bot], Google [Bot], Sogou [Bot], Yahoo [Bot]