引用官方文档的内容MySQL中distinct和distinctrow的区别

原文:The ALL and DISTINCT modifiers specify whether duplicate rows should be returned. ALL (the default) specifies that all matching rows should be returned, including duplicates. DISTINCT specifies removal of duplicate rows from the result set. It is an error to specify both modifiers. DISTINCTROW is a synonym for DISTINCT.

译文:ALL和DISTINCT修饰符指定是否应返回重复的行。ALL(默认值)指定应返回所有匹配的行,包括重复的行。DISTINCT指定从结果集中删除重复行。指定两个修饰符都是错误的。DISTINCTROW是DISTINCT的同义词。

一句话就是:distinct和distinctrow是一样,只能使用all、distinct、distinctrow中的一个,不能同时使用多个【默认为all】

Logo

更多推荐