Select * from account where userName like 'ad % ';
Select * from account where userName> = 'ad' and userName <'AE ';
/*
The results of these two queries are the same, and the efficiency seems to be similar. No specific efficiency test is conducted. If you are interested, you can test the efficiency.
In the like query, ad % is the data of userName starting with ad,
UserName> = 'ad' is used to query data starting with ad and also contains AE, af, ag ......, That is, to query data where "ad" contains d and is greater than d in "ad"
Therefore, and userName <'ad' ensures that the query interval is in "ad", while AE, af, ag ...... This data will not appear in the result set.
Of course, you can try:
Select * from account where userName> = 'ad' and userName <'az ';
Does the result set contain: AE, af, ag ...... Ak, al ...... Data starting with ay and az.
*/
Author: hoojo
Source: http://www.blogjava.net/hoojo/archive/2011/10/27/362173.html