Sql
hi_beijing
这个作者很懒,什么都没留下…
展开
-
sql 一对多表自引用
select [b]distinct[/b] .AreaID,a.AreaName,b.AreaID,b.AreaName,c.AreaID,c.AreaName from [b]表名 1[/b] as a , [b]表名1[/b] as b , [b]表名1[/b] as c , [b]表名2[/b] as pinpai where a.AreaID = big and b.AreaID ...原创 2011-07-10 15:17:11 · 239 阅读 · 0 评论 -
sql2005数据库添加外键级联删除外键对应的主键行
alter TABLE Asp_News with check add constraint foreignKey_News_UserID Foreign Key (UserID) References Asp_Members(ID) On Delete Cascade Not For Replication GO原创 2011-07-30 15:59:08 · 132 阅读 · 0 评论 -
常用SQL语句
MySql分组查询语句: from Share as s left join fetch s.ruid Where s.ruid.ruid in(select f.friendRuid from Friends as f Where f.ruid.ruid=?) or s.ruid.ruid=? group by s.typeId,s.itemId order by count(s.conte...原创 2011-12-31 11:33:47 · 67 阅读 · 0 评论