Reputation: 72
i have two item in the days column ("sun,mon"). For getting the subject according to the day, i have to fire a query by comparing the individual day, but there are two or more days in a single column. how could this be done in #Android?
Upvotes: 0
Views: 53
Reputation: 6866
You want the SQL LIKE
operator, which lets you use simple wildcards: %
to match zero-or-more arbitrary characters, and _
to match exactly one arbitrary character.
So you'd do:
SELECT stuff FROM mytable WHERE days LIKE '%sun%'
This will be slow if you have a lot of rows in that table, though. If that's the case, you'll need a different table design.
Upvotes: 1