Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/mysql/72.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/cplusplus/151.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Mysql DISTINCT有长度限制吗?_Mysql_Distinct - Fatal编程技术网

Mysql DISTINCT有长度限制吗?

Mysql DISTINCT有长度限制吗?,mysql,distinct,Mysql,Distinct,我将图像像base64字符串一样存储在数据库中 DB是标准化的,在使用联接时,我使用DISTINCT来转义重复项 问题是我的查询只返回一个图像 这些字符串在开始时是相同的,可能是元数据或其他东西 DISTINCT有长度限制吗 是不是DISTINCT将这些字符串截断到最大长度,对它们进行比较并确定它们是相同的 编辑 我对“图像”列使用文本数据类型。字符串大约有4000个字符长,所以我认为这就足够了 问题是 SELECT goods.id, goods.title, goods.descriptio

我将图像像base64字符串一样存储在数据库中

DB是标准化的,在使用联接时,我使用DISTINCT来转义重复项

问题是我的查询只返回一个图像

这些字符串在开始时是相同的,可能是元数据或其他东西

DISTINCT有长度限制吗

是不是DISTINCT将这些字符串截断到最大长度,对它们进行比较并确定它们是相同的

编辑

我对“图像”列使用文本数据类型。字符串大约有4000个字符长,所以我认为这就足够了

问题是

SELECT goods.id, goods.title, goods.description, goods.image, goods.price, goods.title, 
GROUP_CONCAT(DISTINCT ingredients.title) AS ingredients_title, 
GROUP_CONCAT(DISTINCT ingredients.description) AS ingredients_description, 
GROUP_CONCAT(DISTINCT ingredients.image) AS ingredients_image, 
GROUP_CONCAT(DISTINCT composition.title) AS composition_title, 
GROUP_CONCAT(DISTINCT goods_composition.value) AS goods_compositionvalue FROM goods 
INNER JOIN goods_ingredients ON goods_ingredients.good_id = goods.id 
INNER JOIN ingredients ON goods_ingredients.ingredient_id = ingredients.id 
INNER JOIN goods_composition ON goods_composition.good_id = goods.id 
INNER JOIN composition ON goods_composition.composition_id = composition.id 
WHERE goods.id = :goods_id
组_CONCAT()本身有一个长度限制

它由选项配置。默认值为1024字节


这与您是否在调用中使用DISTINCT无关。

您使用什么列数据类型来存储这些base64字符串?请回答您的问题。使用图像散列来识别唯一性否,DISTINCT不应进行任何截断。是否显示模式、示例数据和查询?