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.
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.
http://dev.mysql.com/doc/refman/5.0/en/func-op-summary-ref.html
I SOLVEd MY PROBLEM...thank you
use left and right :-)
in regexp like this
select myletters from testing_letters where myletters regexp '^AAAA' and myletter regexp 'DDDD$'
thank you
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.