Short Term Solution
Use the FIND_IN_SET function:
WHERE FIND_IN_SET('Queensland', csv_column)
...because using LIKE with wildcards on either end is risky, depending on how much/little matches (and it also ensures a table scan). Performance of LIKE with wildcards on either side is on par with REGEXP--that means bad.
Long Term Solution
Don't store comma separated values -- use a proper many-to-many relationship, involving three tables:
Things
Australian States
- State_id (primary key)
- State_name
Things_to_Auz_States
- thing_id (primary key, foreign key to
THINGS
table)
- State_id (primary key, foreign key to
AUSTRALIAN_STATES
table)
You'll need JOINs to get data out of the three tables, but if you want to know things like how many are associated to a particular state, or two particular states, it's the proper model.