I have a simple question regarding LIKE clauses in MySQL.


I have a table that contains a comma-delimited list of zip codes. I have another table that contains addresses. I would like to pull all the records from the second table where the zip code is contained in the zip code field of the first table. The following query is not getting me any results, notice the LIKE clause:


SELECT event_id, title, city, state, zip, event_date FROM Event ev, ref_mma rm WHERE rm.area_id = 7 AND ev.zip LIKE rm.zips AND active_ind = 1 AND private_ind = 0


In SQL Server or Oracle, this would be a simple IN clause, but things don't work that way with MySQL.


Help?


M
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

Reply via email to