像PostgreSQL中一样,MySQL中是否有任何数组数据类型? [英] Is there any array data type in MySQL like in PostgreSQL?

查看:246
本文介绍了像PostgreSQL中一样,MySQL中是否有任何数组数据类型?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要在MySQL数据库中存储整数数组.在MySQL中有等同于此的东西吗?

I need to store arrays of integers in a MySQL database. In there something equivalent to this in MySQL?

 CREATE TABLE tictactoe (
    squares   integer[3][3]
);

我想存储尺寸为20x6的矩阵.我不想创建包含120列的表格.无需查询此字段,只需存储和检索完整矩阵.

I want to store matrices with dimension 20x6. I don't feel like creating a table with 120 columns. There is no need to query on this field, just need to store and retrieve full matrices.

如果有关系,我可以使用Perl.

If it matters, i use Perl.

推荐答案

不,没有这样的东西.为此,有一个打开工作日志,但是在实现上没有任何进展此功能.

No, there is no such thing. There is an open worklog for that, but no progress has been made on implementing this feature.

您必须使用多个字段(在您的情况下为9)以某种方式进行模拟,或者将整数打包为更大的数据类型(例如blob).

You have to emulate this somehow, using either multiple fields (9 in your case) or pack the integers together into a larger datatype (blob for example).

这篇关于像PostgreSQL中一样,MySQL中是否有任何数组数据类型?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆