List:General Discussion« Previous MessageNext Message »
From:Paul DuBois Date:June 12 2002 5:49pm
Subject:Re: ENUM query question
View as plain text  
At 12:42 -0500 6/12/02, Jeff Field wrote:
>I have a quick question regarding queries that involve values in ENUM
>columns.  Here's the scenario:
>
>I have an ENUM column (category) that can have the values ('Gambling',
>'Geographic', 'Medical', 'Sports').  Most of the records have only one of
>the category descriptions but some are categorized in two or more of the
>category descriptions.

That's impossible.  It sounds like you really mean SET, not ENUM.

>When I do a query and my WHERE clause is
>
>WHERE category = 'Gambling'
>
>it only pulls the records for which 'Gambling' is the only value.  To get
>*all* the records, including the records where the category value might be
>(Gambling, Sports), I have to use the wildcard, as in
>
>WHERE category = '%Gambling%'
>
>Here's the question:
>
>Although this may be exactly what I have to do to get those records, my own
>personal expectation was that the first query (without the wildcards) should
>have been fine.  Is having to use wildcards with an ENUM column in the WHERE
>clause correct?  Or, am I missing something here?
>
>Thanks!
>
>Jeff

Thread
MySQl priceMySQL Newsgroup11 Jun
  • Re: MySQl pricecal11 Jun
  • Re: MySQl priceVictoria Reznichenko11 Jun
RE: MySQl priceWalt Weaver11 Jun
  • Re: RE: MySQl priceVictoria Reznichenko12 Jun
RE: RE: MySQl priceWalt Weaver12 Jun
  • ENUM query questionJeff Field12 Jun
    • Re: ENUM query questionPaul DuBois12 Jun
      • RE: SET query question (was ENUM query question)Jeff Field12 Jun
    • Re: ENUM query questionDay Irmiter13 Jun