Home No operator matches the given name and argument type(s): What needs to be cast?
Reply: 0

No operator matches the given name and argument type(s): What needs to be cast?

user787
1#
user787 Published in June 23, 2018, 2:28 am

I'm getting an error, and I cannot figure out why. I know the error is telling me to cast a type but I'm not sure on what?

What part of CASE is the operator?

ERROR:  operator does not exist: character varying = boolean
LINE 6:              WHEN lower(foo.name) SIMILAR TO '%(foo
                    ^
HINT:  No operator matches the given name and argument type(s). You might need to add explicit type casts.

My query:

SELECT foo.name,
       bar.city,
       MAX(foo.total - bar.tax_amount),
       CASE bar.name
            WHEN lower(foo.name) SIMILAR TO '%(foo|bar|baz)%' THEN true
            ELSE false
        END
        ....
GROUP BY foo.name, bar.city;
You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.310971 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO