我的目标是从存在大量重复值的“EmbedImgDimension”列中选择值。Mysql:如何从数据库列中选择不同的值
我用下面的查询
select
distinct EmbedImgId,
VideoID,
EmbedImgHeight,
EmbedImgWidth,
EmbedImgFileName,
concat(embedimgwidth,' x ',embedimgheight) as EmbedImgDimension
from embedimages
inner join Video on Video.schoolid=#Value#
where embedimages.isdeleted=0 order by embedimages.embedimgwidth asc;
笏修改应该怎么做在此查询,以便从“EmbedImgDimension” column.Any帮助将十分赞赏选择唯一值。
谢谢。
如果你想获得不同的值,你必须删除非独特的值(如video_ids)。你现在的方式,数据库试图找到video_id,EmbedImgId等独特的组合(这可能是独特的,所以你不会得到任何分组) – Nicolas78 2010-08-05 09:57:14
@ nicolas78:谢谢朋友......但我也需要实施 选择 不同EmbedImgId, VideoID的, EmbedImgHeight, EmbedImgWidth, EmbedImgFileName我的查询......所以笏可以做... – GethuJohn 2010-08-05 10:02:27
检查我的更新。我认为你想在逻辑上不可能,但也许你可以进一步详细说明 – Nicolas78 2010-08-05 10:07:19