Sign in to follow this  
Followers 0
ChrisL

Anyone any good with sqlite?

4 posts in this topic

I want to do a search for a string but I don't want to specify a column to search.

Is this possible?

SELECT * FROM Persons WHERE "any column"='Sandnes'

At the moment I'm getting all rows and doing a stringinStr() for each row but I'm hoping I can do it with the sql statement instead.

Thanks

Chris

Share this post


Link to post
Share on other sites



Granted your table and database names are correct, that's the correct syntax to use in sql.

Share this post


Link to post
Share on other sites

I would imagine that your will have to structure your query for all Columns, e.g.

SELECT * FROM Persons WHERE (Column1 = 'Sandnes') or (Column2 = 'Sandnes') or (Column3 = 'Sandnes') ...

Thats how I would do it in any other SQL database


----[ SandyD ]---

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0