根据字段去重查询所有数据
2015-06-08 12:24
323 查看
select distinct aa,* from TableInfo
where ID in (select MAX(ID) from TableInfogroup by aa)
select top 5 * from CH_PlanInfo left join CH_PlanTypeInfo on CH_PlanInfo.PlanTypeID=CH_PlanTypeInfo.PlanTypeID
where PlanID in (select MAX(PlanID) from CH_PlanInfo group by PlanCard)
where ID in (select MAX(ID) from TableInfogroup by aa)
select top 5 * from CH_PlanInfo left join CH_PlanTypeInfo on CH_PlanInfo.PlanTypeID=CH_PlanTypeInfo.PlanTypeID
where PlanID in (select MAX(PlanID) from CH_PlanInfo group by PlanCard)
相关文章推荐
- 统计字符串中每个字母出现的次数。
- HangOver
- webview在红米3上面打开显示错误A WebView method was called on thread 'Thread-9191'. All WebView methods must be
- phpStorm8注册码
- Android学习笔记(1)
- ActiveAndroid 管理数据库以及ActiveAndroid 如何管理boolean类型
- python下MySQLdb用法实例分析
- 结构体定义 typedef struct
- iOS 四种延时的方法
- 配置hive使用mysql存储metadata metadatastore
- linux下备份数据库
- [Windows] Caffe安装配置
- csdn收藏夹
- .hivehistory
- iOS 极光推送遇到的问题
- 图解HTTP 上
- .hiverc
- 安装AndroidStdio时出现“could not find main class com/intelligi/idea/Main”错误
- 思科换帅
- String,CString,TCHAR*,char*之间区别和联系