如何计算varchar列中的不同值

时间:2018-10-01 19:41:36

标签: mysql sql

我当前正在尝试计算其中包含不同值的列。

我感兴趣的列是 routes ,但是我遇到的问题是该列的数据类型是VARCHAR。

我想知道是否有一种方法可以计算此列中出现的不同事件。

+---------+-------------------------+-----------------------------+-----------------------------------------------+-----------+------------+-----------------+----------+-----------------------------+
| stop_id | on_street               | cross_street                | routes                                        | boardings | alightings | month_beginning | day_type | location                    |
+---------+-------------------------+-----------------------------+-----------------------------------------------+-----------+------------+-----------------+----------+-----------------------------+
|       1 | JACKSON                 | AUSTIN                      | 126                                           |       183 |        150 | 2012-10-01      | Weekday  | (41.87632184, -87.77410482) |
|      48 | HARRISON                | WOOD                        | 126                                           |         1 |          2 | 2012-10-01      | Weekday  | (41.87405900, -87.67133400) |
|      50 | ASHLAND                 | CONGRESS                    | 9,126                                         |        15 |         27 | 2012-10-01      | Weekday  | (41.87508698, -87.66643194) |
|      52 | JACKSON                 | 1900 W.(MALCOLM X COLL.)    | 126                                           |        83 |        229 | 2012-10-01      | Weekday  | (41.87743988, -87.67402389) |
|      69 | JACKSON                 | FINANCIAL PLACE             | 1,7,X28,126,129,130,132,151                   |       118 |        185 | 2012-10-01      | Weekday  | (41.87808100, -87.63286800) |
|      71 | JACKSON                 | STATE                       | 1,7,X28,126,129,130                           |       201 |        750 | 2012-10-01      | Weekday  | (41.87814100, -87.62789900) |
|      73 | MICHIGAN                | betw. VAN BUREN & CONGRES   | 1,3,4,7,J14,26,X28,126,129,132,143,147,148    |       966 |        922 | 2012-10-01      | Weekday  | (41.87627100, -87.62439600) |
|      75 | MICHIGAN                | VAN BUREN                   | 1,7,X28,126,129                               |       290 |         91 | 2012-10-01      | Weekday  | (41.87669000, -87.62416000) |

0 个答案:

没有答案