简体   繁体   English

在MySQL中存储物理尺寸

[英]Store physical dimensions in MySQL

I often store the dimensions of a product in my database by having X, Y and Z columns. 我经常通过X,Y和Z列将产品的尺寸存储在数据库中。

Is this the best way of doing it or is their a better way? 这是最好的方法还是更好的方法? I have heard that there is a spatial datatype in MySQL, would that be relevant in this case? 我听说MySQL中有一个空间数据类型,在这种情况下会有用吗?

If you store physical dimensions of an object, that is far away from anything which a spatial datatype tries to represent. 如果存储对象的物理尺寸,则与空间数据类型尝试表示的任何内容都相去甚远。 Spatial Datatypes are for Location-Information (eg Points on globe or Points on a plane) and contain x and y values for geometry data (describing local spaces, like Football fields) or longitude and latitude (describing global spaces) 空间数据类型用于位置信息(例如,地球上的点或飞机上的点),并包含几何数据(描述局部空间,例如足球场)或经度和纬度(描述全局空间)的x和y值

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM