经典sql语句

来源:互联网 发布:开票软件170612 编辑:程序博客网 时间:2024/05/20 19:49

select a.title,a.username,b.adddatefrom table a,(select max(adddate) adddate from table where table.title=a.title) b

这里select max(adddate) adddate from table where table.title=a.title就相当于一个临时表把

delete from table1 where not exists ( select * from table2 where table1.field1=table2.field1 )

有条件删除




原创粉丝点击