View Single Post
  #3 (permalink)  
Old January 11th, 2008, 04:32 PM
hman hman is offline
Authorized User
 
Join Date: Jun 2004
Location: , , .
Posts: 25
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
quote:Originally posted by urtrivedi


SELECT * where REVERSE(LEFT(REVERSE(email),LOCATE('.',REVERSE(ema il)) - 1)) ='uk' FROM table

above query will give you list of emails ending with .uk

Also refer to
http://dev.mysql.com/doc/refman/5.0/...-functions.htm

urt
Hi urt,

I tried your query changing the table name, but it seems to throw an error?
I am running it on MySql 4.1 in MySQLadmin.

Code:
#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'where REVERSE( LEFT( REVERSE( email ) , LOCATE( '.' , REVERSE( email ) ) - 1 ) )' at line 1
Please advise

Ian