I have an SP and part of it states this:
AND t_phlcm.VAT_FG <> "~"
Can you explain the <> "~" part? Does tilde (~) has a special meaning in SQL like % does?
"~" part? Does tilde (~) has a special mea..." /> "~" part? Does tilde (~) has a special mea..." /> "~" part? Does tilde (~) has a special mea..."/>
I have an SP and part of it states this:
AND t_phlcm.VAT_FG <> "~"
Can you explain the <> "~" part? Does tilde (~) has a special meaning in SQL like % does?
All SQL server versions after 2014 supports '~' operator, its bitwise not operator. I use it mostly to invert value of some flags (bit columns) in my DB. You can see more here.
This is an example of simple string comparison which says
t_phlcm.VAT_FG must not be equal to "~" character.
Although
~
can be used with regular expressions in Postgres like this :SELECT * FROM table where name ~ '^ABC'
and is more powerful but is not advised as LIKE(~~) is more fast. Please refer this
Generally speaking
~
is used to complement an integer or bit like this:Update Users Set [Status] = ~[Status]
will invert the status of all users.