I'm trying to write a SQL query that will remove all spaces so that if a string only has spaces the final string is just ''.
I've tried this code but apparently it isn't working for more than one space:
regexp_replace(:P14_search_text, '( ){1,}', '')
Being :P14_search_text
the string I want to modify.
Any help?
DML SQL query with space in a column name When we run INSERT, UPDATE, and DELETE statements, we must use a square bracket or double quotes to handle the column name with space.
To delete blank lines from a query, use the Delete blank Lines button on the query toolbar.
After you use a DELETE statement in Microsoft SQL Server to delete data from a table, you may notice that the space that the table uses is not completely released.
Returns a Variant (String) containing a copy of a specified string without leading spaces (LTrim), trailing spaces (RTrim), or both leading and trailing spaces (Trim). Syntax. LTrim ( string ) RTrim ( string ) Trim( string )
how about:
regexp_replace(:P14_search_text, '[[:space:]]*', '');
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With