您如何从mysql中选择字符串中的最后一个字符= x? [英] How do you select from mysql where last character in a string = x?
本文介绍了您如何从mysql中选择字符串中的最后一个字符= x?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想从数据库中选择mov_id列中的最后一个字符等于1和2的行.
I'd like to select rows from the database where the last character in the mov_id column equals to 1 and 2.
查询的外观如何?
推荐答案
SELECT * FROM `myTable` WHERE `mov_id` LIKE '%1' OR `mov_id` LIKE '%2'
%
字符是一个通配符,可以匹配任何内容(例如*
在许多其他地方)
the %
character is a wildcard which matches anything (like *
in many other places)
这篇关于您如何从mysql中选择字符串中的最后一个字符= x?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文