河流(River)的专栏

duming115的技术博客

用户操作
[即时聊天] [发私信] [加为好友]
河流(River)--duming115ID:duming115
16804次访问,排名7098(-1)好友0人,关注者1
喜欢编程,也喜欢看一些编程的书
duming115的文章
原创 31 篇
翻译 14 篇
转载 68 篇
评论 4 篇
最近评论
duming115:1.索引页面是指索引页面中的文字,索引标签来说没有意义,不过搜索引擎会根据文字所在的不同标签内进行区域划分,比如标题等.
2.跟踪页面中的链接,是指的页面的pr值的传递,每个页面(url地址)都有一个pr值,这些pr值会传递给页面中的链接.
3.页面快照应该是指的google的搜索结果中的网页快照吧,应该是google的缓存.
sunshinebailin:学习了,只是有一些术语不太明白,如索引当前页面指的是索引页面的文字,还是页面元素?还有跟踪当前页面中所有的链接是什么意思?还有保存页面快照是什么东东?
psnccs:Wow gold
psnccs:Wow gold
文章分类
收藏
    相册
    seo--搜索引擎优化
    seobook
    搜索引擎优化SEO每天一贴_zac的博客
    点石互动
    我的好友
    健康快乐每一天
    邹可见的技术博客
    存档
    订阅我的博客
    XML聚合  FeedSky

    原创 工作中的笔记:删除多个表中的关联记录--2008.04.15收藏

    新一篇: jsf in action 笔记:通过值绑定初始化Bean(Setting values with value-binding expressions)--2008.04.15  | 旧一篇: jsf in action 笔记:bean的创建和初始化(四)(List,Map作为单独的managed bean)--2008.04.13

    2008.04.15 以下的内容只是针对MySql数据库

    1. sql语句删除两个或多个关联中的数据

        以前因为对数据库中的数据只是进行简单的操作,通常只是删除一个表中的数据(因为表与表中的关联性比较差,没有外键这样的约束),就像这样

    delete 
    from tableA a
    where
    1=1
    and a.id
    =1;

    delete后面不用指定表的名称,直到最近要删除两个表中的数据,表A与表B,表B中的内容是附属于表A的,也就是说如果表A中的某一条记录删除了,表B中的记录也要删除,因为如果不删除B中的记录,那就会形成垃圾数据,

    表A中的一项为itemid,表B中也一个Column也为itemid,是以外键的形式指向表A.

    当我这样写的时候就报错了:

    delete 
    from 
    A a,
    B b
    where
    1=1
    and a.itemid
    =b.itemid
    and a.id
    <5

    提示你where后的语句有问题(当然问题不在where语句),当from后面的表涉及到多个的时候,这个语句就要有点变化了

    这样
    delete 
    a,b
    from 
    A a,B b
    where
    1=1
    and a.itemid
    =b.itemid
    and a.id
    <5

    或者是这样
    delete 
    from 
    a,b
    using A a,B b
    where
    1=1
    and a.itemid
    =b.itemid
    and a.id
    <5

    from 中的表的名称没有先后顺序的要求,以下为<Sams - Mysql Tutorial(2003).chm>中的说明:

    delete 语法:
    DELETE [LOW_PRIORITY] [QUICK] FROM table_name
           
    [WHERE where_definition]
           
    [ORDER BY ...]
           
    [LIMIT rows]

    or

    DELETE [LOW_PRIORITY] [QUICK] table_name[.*] [, table_name[.*] ...]
           
    FROM table-references
           
    [WHERE where_definition]

    or

    DELETE [LOW_PRIORITY] [QUICK]
           
    FROM table_name[.*] [, table_name[.*] ...]
           USING 
    table-references
           
    [WHERE where_definition]

    示例代码为:

    1. 删除一个表中的数据
    delete from department where name='Asset Management';

    2. 删除两个表中的数据
    delete employee, employeeSkills
    from employee, employeeSkills, department
    where employee.employeeID = employeeSkills.employeeID
    and employee.departmentID = department.departmentID
    and department.name='Finance';

    3. 删除两个表中的数据,用using语法
    delete from employee, employeeSkills
    using employee, employeeSkills, department
    where employee.employeeID = employeeSkills.employeeID
    and employee.departmentID = department.departmentID
    and department.name='Finance';


    2. 有时候在页面中找一段文字是比较麻烦的一件事,特别是这个页面是动态生成的时候,如果是用的Eclipse的开发平台,可以用ctrl+H来开启查找界面,可以查找某个类中的某个属性或者方法被那个地方调用了,也可以查找某个页面中包含要找的字段.如果应用部署在linux上,可以用grep "要查找的字段" /us***/doc/**.html ,其中"/us***/doc/**.html "为要查找的文件范围,可以用*来表示匹配任意的字符串,这样就可以限定查找的范围了,用这种查找命令来查找,还真是挺方便的.

    发表于 @ 2008年04月15日 14:06:00|评论(loading...)|编辑

    新一篇: jsf in action 笔记:通过值绑定初始化Bean(Setting values with value-binding expressions)--2008.04.15  | 旧一篇: jsf in action 笔记:bean的创建和初始化(四)(List,Map作为单独的managed bean)--2008.04.13

    评论:没有评论。

    发表评论  


    当前用户设置只有注册用户才能发表评论。如果你没有登录,请点击登录
    Csdn Blog version 3.1a
    Copyright © 河流(River)--duming115