mysql> Select * from examination_btech;
+-----------+----------+--------+
| RollNo | Name | Course |
+-----------+----------+--------+
| 201712001 | Rahul | B.tech |
| 201712002 | Raman | B.tech |
| 201712003 | Sahil | B.tech |
| 201712004 | Shalini | B.tech |
| 201712005 | Pankaj | B.tech |
| 201712006 | Mohan | B.tech |
| 201712007 | Yash | B.tech |
| 201712008 | digvijay | B.tech |
| 201712009 | Gurdas | B.tech |
| 201712010 | Preeti | B.tech |
+-----------+----------+--------+
10 rows in set (0.00 sec)
现在,如果我们想从一系列滚动中获取最后三个字符,那么可以借助 RIGHT() 函数来完成,如下所示 -
mysql> Select RIGHT(RollNo, 3) FROM examination_btech;
+------------------+
| RIGHT(RollNo, 3) |
+------------------+
| 001 |
| 002 |
| 003 |
| 004 |
| 005 |
| 006 |
| 007 |
| 008 |
| 009 |
| 010 |
+------------------+
10 rows in set (0.00 sec)
登录后复制
以上就是我们如何从 MySQL 表列中存储的数据中获取最后的字符数?的详细内容,更多请关注每日运维网(www.mryunwei.com)其它相关文章!