<bdo id='fPLi5'></bdo><ul id='fPLi5'></ul>
    1. <legend id='fPLi5'><style id='fPLi5'><dir id='fPLi5'><q id='fPLi5'></q></dir></style></legend>

      <small id='fPLi5'></small><noframes id='fPLi5'>

      <tfoot id='fPLi5'></tfoot>
    2. <i id='fPLi5'><tr id='fPLi5'><dt id='fPLi5'><q id='fPLi5'><span id='fPLi5'><b id='fPLi5'><form id='fPLi5'><ins id='fPLi5'></ins><ul id='fPLi5'></ul><sub id='fPLi5'></sub></form><legend id='fPLi5'></legend><bdo id='fPLi5'><pre id='fPLi5'><center id='fPLi5'></center></pre></bdo></b><th id='fPLi5'></th></span></q></dt></tr></i><div id='fPLi5'><tfoot id='fPLi5'></tfoot><dl id='fPLi5'><fieldset id='fPLi5'></fieldset></dl></div>

        Mysql 可以拆分列吗?

        时间:2023-08-18

          <tbody id='roRp3'></tbody>
        <legend id='roRp3'><style id='roRp3'><dir id='roRp3'><q id='roRp3'></q></dir></style></legend>

        • <bdo id='roRp3'></bdo><ul id='roRp3'></ul>
              • <tfoot id='roRp3'></tfoot>

                <small id='roRp3'></small><noframes id='roRp3'>

                <i id='roRp3'><tr id='roRp3'><dt id='roRp3'><q id='roRp3'><span id='roRp3'><b id='roRp3'><form id='roRp3'><ins id='roRp3'></ins><ul id='roRp3'></ul><sub id='roRp3'></sub></form><legend id='roRp3'></legend><bdo id='roRp3'><pre id='roRp3'><center id='roRp3'></center></pre></bdo></b><th id='roRp3'></th></span></q></dt></tr></i><div id='roRp3'><tfoot id='roRp3'></tfoot><dl id='roRp3'><fieldset id='roRp3'></fieldset></dl></div>

                  本文介绍了Mysql 可以拆分列吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  我有一列包含逗号分隔的数据:

                  I have a column that has comma separated data:

                  1,2,3
                  3,2,1
                  4,5,6
                  5,5,5
                  

                  我正在尝试运行将分别查询 CSV 字符串的每个值的搜索.

                  I'm trying to run a search that would query each value of the CSV string individually.

                  0<first<5   and  1<second<3  and  2<third<4 
                  

                  我知道我可以返回所有查询并自己拆分并自己比较.我很好奇是否有办法做到这一点,以便 mysql 进行处理工作.谢谢!

                  I get that I could return all queries and split it myself and compare it myself. I'm curious if there is a way to do this so mysql does that processing work. Thanks!

                  推荐答案

                  使用

                  substring_index(`column`,',',1) ==> first value
                  substring_index(substring_index(`column`,',',-2),',',1)=> second value
                  substring_index(substring_index(`column`,',',-1),',',1)=> third value
                  

                  在你的 where 子句中.

                  in your where clause.

                  SELECT * FROM `table`
                  WHERE 
                  substring_index(`column`,',',1)<0 
                  AND
                  substring_index(`column`,',',1)>5
                  

                  这篇关于Mysql 可以拆分列吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:在同一列上使用多个 WHERE 条件进行选择 下一篇:如何在 MySQL 上进行 SQL 区分大小写的字符串比较

                  相关文章

                  最新文章

                1. <legend id='MpZM8'><style id='MpZM8'><dir id='MpZM8'><q id='MpZM8'></q></dir></style></legend>
                2. <small id='MpZM8'></small><noframes id='MpZM8'>

                      <bdo id='MpZM8'></bdo><ul id='MpZM8'></ul>

                    <tfoot id='MpZM8'></tfoot>

                      <i id='MpZM8'><tr id='MpZM8'><dt id='MpZM8'><q id='MpZM8'><span id='MpZM8'><b id='MpZM8'><form id='MpZM8'><ins id='MpZM8'></ins><ul id='MpZM8'></ul><sub id='MpZM8'></sub></form><legend id='MpZM8'></legend><bdo id='MpZM8'><pre id='MpZM8'><center id='MpZM8'></center></pre></bdo></b><th id='MpZM8'></th></span></q></dt></tr></i><div id='MpZM8'><tfoot id='MpZM8'></tfoot><dl id='MpZM8'><fieldset id='MpZM8'></fieldset></dl></div>