Jump to content

finding a value in a field which contains an array


glennn.php

Recommended Posts

i have a field, "models", which will contain an array such as "Acura, Camaro, Blazer" - i'm trying to learn how to use IN to get any row that would contain "Acura" within that field.

 

SELECT * from TABLE WHERE 'Acura' IN 'models'...? that didn't work...

 

anyone...?

 

thanks much

 

GN

Link to comment
Share on other sites

Its generally a poor design that leads you to storing comma separated strings within a field. You should look at normalization techniques and give each of those delimited values its own row.

Link to comment
Share on other sites

very true. i'm not good at JOINS and multiple tables, especially when the client wants to pay budget scale...

 

be that as it is, can you show me how i'd get Acura out of that array? i am in fact researching how i'd normalize this table - i hate to do a bad job even when the money isn't right.

 

i'm much obliged...

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.