求教一条SQL语句 在线等啊 string strk = "select top 20 MobileTheme.ThemeName ,MobileTheme .DownLoadUrl,MobileThemePreviews .Preview from MobileTheme join MobileThemePreviews on MobileThemePreviews.MobileThemeId=MobileTheme.Id order by Downloads desc";
为什么我这条SQL语句读取出来的数据 同一条数据会显示两次呢? 要怎样修改呢? 求教大神
------解决方案-------------------- select distinct ....
------解决方案-------------------- select top 20 MobileTheme.ThemeName , MobileTheme .DownLoadUrl, MobileThemePreviews .Preview from MobileTheme join MobileThemePreviews on MobileThemePreviews.MobileThemeId=MobileTheme.Id group by MobileTheme.ThemeName , MobileTheme .DownLoadUrl, MobileThemePreviews .Preview order by Downloads desc 加个 group by
------解决方案--------------------