mysql - SQL match on letter and number arrangement -
is possible write sql statement finds rows match specific arrangement of letters/numbers?
i.e. select mycol mytable mycol='<letter><letter><number>'
should return 12x , 34y not 123x or 34yy
i using mysql.
i haven't got mysql on machine test think
select mycol mytable mycol regexp '^[0-9][0-9][a-z]$'
should it. ^
anchor start of string, $
end of string , rest should self explanatory.
looks use regexp '^[[:digit:]][[:digit:]][[:alpha:]]$'
untested , going off docs.
Comments
Post a Comment