Question: Use the% (Percent semicolon) in the MySQL statement to get more execution efficiency slower!
Total spents: 0.0489 seconds 0.0691 0.0485 0.0467
SELECT ' Goods_name ', ' goods_img ', ' sku_id ', ' import ' from ' goods ' WHERE ' goods_name ' like '%iphone%ipod% ' and ' stime ' < 1413877244 and ' etime ' > 1413877244 order BY ' flag ' DESC
Total spents: 0.0460 seconds 0.0430 0.0493 0.0783 0.0496
SELECT ' Goods_name ', ' goods_img ', ' sku_id ', ' import ' from ' goods ' WHERE ' goods_name ' like '%iphone% ' and ' goods_name ' like '%ipod% ' and ' stime ' < 1413877367 and ' etime ' > 1413877367 order BY ' flag ' DESC
Total: 0.0458 seconds, 0.0441 seconds, 0.0449 seconds.
SELECT ' Goods_name ', ' goods_img ', ' sku_id ', ' import ' from ' goods ' WHERE ' goods_name ' like '%%%%%%%%%%%%%%%%%%%%%%%iphone %ipod%%%%%%%%%%%%%%%%%%%%%%% ' and ' stime ' < 1413877997 and ' etime ' > 1413877997 order BY ' flag ' DESC
Practice has shown that the number of percent semicolons does not affect the speed of SQL execution. The efficiency of these methods is almost the same.
These are the results of my test. The individual may according to own actual demand to choose the writing! The suggestion is the best choice second kind!