Skip to content Skip to sidebar Skip to footer

Search In Postgresql Table

I have this table in which I would like to implement search filter. CREATE TABLE ACCOUNT( ID INTEGER NOT NULL, USER_NAME TEXT, PASSWD TEXT, FIRST_NAME TEXT, LAST_NAME TEXT, L

Solution 1:

You have a type conversion problem with the IN list. These all have to be the same type, so they are converted to the type of what is being compared. And, there is a failure to convert strings to ints.

If you include single quotes, then your query should work:

WHERE'" + searchString + "'IN (ID, USER_NAME, FIRST_NAME, LAST_NAME) 

Post a Comment for "Search In Postgresql Table"