Roger wrote:
Thanks for the response guys but then my problem comes when i try and
query a range between T and Z i tried to make it query between T to A
but got no result. Anyway i will have to add a constraint in my PHP code
for T to Z.

I saw that coming, but you didn't ask about that bit. ;)

In ASCII the character after Z is '[' not 'A' so

  Select *
  From People
  Where Surname Between 'T%' and '[%'
  Order by UPPER(Surname);

might be good enough for your application, but you'd need to check that if you're going to be using other character sets.

Your other approach is to use substr(Surname,1,1). This might be slower but the docs say it handles UTF-8 so it's probably the way to go.

  Select *
  From People
  Where substr(Surname,1,1) Between 'T' and 'Z'
  Order by UPPER(Surname);

Martin

-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------

Reply via email to