mysql查询以字符串开头的数据可以有:

    1、select * from a where a.name like ‘H%’

    2、select * from a where left(a.name, 1)=’H’;

    mysql查询不以某个字符串开头:

    select * from a where left(a.name, 1)<>’H’;
    ————————————————
    版权声明:本文为CSDN博主「ZChangfeng」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
    原文链接:https://blog.csdn.net/ZChangfeng/article/details/78032872
    例子

    1. update `dd`
    2. set xzjd=
    3. case
    4. WHEN xzjd='330683001' then '剡湖街道'
    5. WHEN xzjd='330683003' then '鹿山街道'
    6. WHEN xzjd='330683004' then '浦口街道'
    7. WHEN xzjd='330683100' then '甘霖镇'
    8. WHEN xzjd='330683101' then '长乐镇'
    9. WHEN xzjd='330683102' then '崇仁镇'
    10. WHEN xzjd='330683103' then '黄泽镇'
    11. WHEN xzjd='330683104' then '三界镇'
    12. WHEN xzjd='330683107' then '仙岩镇'
    13. WHEN xzjd='330683110' then '下王镇'
    14. WHEN xzjd='330683111' then '石璜镇'
    15. WHEN xzjd='330683112' then '谷来镇'
    16. WHEN xzjd='330683113' then '金庭镇'
    17. WHEN xzjd='330683206' then '贵门乡'
    18. WHEN xzjd='330683002' then '三江街道'
    19. else xzjd end
    20. WHERE left(xzjd, 1)<>'330683';