小弟初学SQL,实现如题功能,写select distinct filename,sizes from fileDB可以查出这两个字段不同时相同的记录,但是想取得这些记录的ID号,这样写就不对了:select id,distinct filename,sizes from fileDB,请高手帮忙解决,谢谢。
解决方案 »
- 请教!一条简单的SQL语句
- 关于一个修改的问题
- 一个用户同时打开多个数据库
- 在同一个INSERT语句中将从一个表中查询出的记录(多条)插入到另外两个表中,并且在插入前先要对每条记录的数据进行处理后再插入,这样可行否?方法如何?急切盼答!!!
- 查询后获取一定记录集,然后另外创建另外一个表(与原表不同)
- 数据对比
- 遇错后,如何中止执行
- 大力、J9988等等请继续关注:全角字符转换的问题。
- 链接服务器的问题?
- 郁闷,不讲道理,总是返回不对?
- 求一SQL语句,查出表一ID,条件是与表二所有ID均不相同的那部分ID
- 请问:为什么安装的sql server2005 在management studio 却运行的是sql server 8.0而不是9.0?
select max(id) as id,filename,sizes from filedb group by filename,sizes2、
select * from filedb as a where id in (select max(id) from filedb where a.filename=filename and a.sizes=sizes)