您的位置:首页 > 数据库

经典sql语句

2013-09-25 10:46 267 查看
select
 
a.title,a.username,b.adddate
from
 
table
 
a,(
select
 
max
(adddate)
adddate
from
 
table
 
where
 
table
.title=a.title)
b
这里
select
 [code]max
(adddate)
adddate
from
 
table
 
where
 
table
.title=a.title就相当于一个临时表把
[/code]
delete
from table1 where not exists ( select * from table2 where table1.field1=table2.field1 )
[/code]有条件删除

                                            
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: