Hi to all keen folks,

can you help me to query the first 4 letters and the last 4 letters in one field.

example: AAAABBBBCCCCDDDD how to query AAAA and DDDD.

thank you.

Quickest option, although it isn't restricted to only four characters would be to:

select * from `example` where `content` like 'AAAA%' or `content` like '%DDDD';

For a more precise solution, I would look to use MySQL regular expressions.

Hope this helps,
R.

in regexp like this

select myletters from testing_letters where myletters regexp '^AAAA' and myletter regexp 'DDDD$'

thank you