SELECT GROUP_ID FROM KM_MAST_GROUP WHERE (OWNER=4629 or CREATED_BY::int=4629)
owner is int and created_by is varchar
I am getting error like invalid input syntax for integer: "null" i am not getting how to do the type casting. Anyone help me
select *
from KM_MAST_GROUP
where CREATED_BY !~ '[0-9]+';
It will give you all rows, where CREATED_BY is not a number. Fix such rows, and your query will work.
Other way is to use strings instead of integers.
SELECT GROUP_ID
FROM KM_MAST_GROUP
WHERE CREATED_BY = '4629';
We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it.OkRead more