I have character varying
entries in a table where some (not all) values contain percentages, e.g., '12%'
, '97%'
, etc. I want to find all the values that contain percentages. In other words, I want to find all values that end with a percent sign ('%'
).
相关问题
- Django distinct is not working
- PostgreSQL: left outer join syntax
- Connecting Python to a Heroku PostgreSQL DB?
- PostgreSQL - Deleting data that are older than an
- Does PLV8 support making http calls to other serve
相关文章
- postgresql 关于使用between and 中是字符串的问题
- postgresql 月份差计算问题
- Using boolean expression in order by clause
- Table valued Parameter Equivalent in Postgresql
- in redshift postgresql can I skip columns with the
- Oracle equivalent of PostgreSQL INSERT…RETURNING *
- PostgreSQL field data type for IPv4 addresses
- Using prepared statement in stored function
You can try like this:
Format
You have to escape the literal % sign. By default the escape character is the backslash:
In this case the first
%
sign matches any starting sequence inmy_column
. The remaining\%
are interpreted as a literal % character. The combination is therefore: match anything that ends in a % character.SQLFiddle
I ended up using regular expressions:
However, I'd still like to know if it's possible using the
LIKE
operator/comparison.