List:General Discussion« Previous MessageNext Message »
From:Paul DuBois Date:May 24 2001 9:15pm
Subject:Re: SELECT and (ordered) ENUMs
View as plain text  
At 6:03 PM -0300 5/24/01, Adriano Nagelschmidt Rodrigues wrote:
>Supposing I have the following column definition:
>level  ENUM('bad', 'good', 'great') NOT NULL
>I would like to be able to do:
>SELECT * FROM foo WHERE level >= 'good'
>Yet this doesn't work (MySQL v 3.23.38). I have to use
>level >= 2 instead.
>Shouldn't a numeric context be applied by the server in this case? eg,

Why?  'good' isn't a number, and it's perfectly legal to compare strings
with the >= operator.

>replacing the label 'good' by 2, instead of doing a string sort.

Paul DuBois, paul@stripped
SELECT and (ordered) ENUMsAdriano Nagelschmidt Rodrigues24 May
  • Re: SELECT and (ordered) ENUMsPaul DuBois24 May