数据库操作

查询表中重复的记录(以name,及price为条件,两条以上同样的记录)
方法1:select name,price, count(*) as b from EXPORT_TABLE where b>1 group by name,price order by b desc
方法2:sqlstr="select price,isbn from EXPORT_TABLE group by price,isbn having count(*)>1

查询并统计表中ID号相同的LIB值

select sum(lib) as libup,book_id from EXPORT_TABLE group by book_id order by book_id desc
posted @ 2005-05-06 13:47  PENGHAO-X  阅读(935)  评论(1编辑  收藏  举报