On 8 Nov 2005 05:28:10 -0800, in mailing.database.mysql "rhamlin"
<rhamlin@eaglebrass.com> wrote:
[color=blue]
>| I'm fairly new to creating complex sql statements and need a little
>| help.
>| In plain english I want to do this: Select menu rows where the row's
>| userGroupIDs equal the user's userGroupIDs.
>|
>| Menu.userGroupID has multiple values seperated by commas.
>| User.userGroupID also has multiple values seperated by commas. I
>| realize some may want me to create seperate tables for these multiple
>| values. The reason I'm using comma seperation at the moment is because
>| I used a multi value <select> on a web page to collect and display the
>| choices from a single table.
>|
>| Could I get an example of how to do this using a comma seperated field?
>|
>| Many thanks.[/color]
Have a look at find_in_set function. The only drawback is that there
can be no spaces within this list i.e find_in_set(id,'1,2,3') not
find_in_set(id,'1, 2, 3')
---------------------------------------------------------------
jnorthau@yourpantsyahoo.com.au : Remove your pants to reply
---------------------------------------------------------------