锘??xml version="1.0" encoding="utf-8" standalone="yes"?>亚洲熟女精品中文字幕,久久亚洲私人国产精品,亚洲A∨无码无在线观看http://m.tkk7.com/jlin/archive/2016/08/16/431599.htmlflyflyTue, 16 Aug 2016 10:46:00 GMThttp://m.tkk7.com/jlin/archive/2016/08/16/431599.htmlhttp://m.tkk7.com/jlin/comments/431599.htmlhttp://m.tkk7.com/jlin/archive/2016/08/16/431599.html#Feedback0http://m.tkk7.com/jlin/comments/commentRss/431599.htmlhttp://m.tkk7.com/jlin/services/trackbacks/431599.html棣栧厛錛宮ysql闇瑕佹暟鎹簱榪炴帴閰嶇疆&allowMultiQueries=true

jdbc:mysql://127.0.0.1:3306/mybank?useUnicode=true&characterEncoding=utf8&allowMultiQueries=true

oracle涓嬫敮鎸佹墽琛屽鏉¤鍙ワ紝涓嬮潰3涓浉鍚?/p>

<update id="batchUpdate" parameterType="java.util.List">
        <foreach collection="list" item="item" index="index" open="begin" close=";end;" separator=";" > 
            update T_EMP_1 
            <set>       
                age = #{item.age}+1,name=#{item.name}
            </set>
            where id = #{item.id}
        </foreach>
</update>

<update id="batchUpdate" parameterType="java.util.List">
        <foreach collection="list" item="item" index="index" open="begin" close="end;" separator="" > 
            update T_EMP_1 
            <set>       
                age = #{item.age}+1,name=#{item.name}
            </set>
            where id = #{item.id};
        </foreach>
    </update>

<update id="batchUpdate" parameterType="java.util.List">
        begin
        <foreach collection="list" item="item" index="index" separator="" > 
            update T_EMP_1 
            <set>       
                age = #{item.age}+1,name=#{item.name}
            </set>
            where id = #{item.id};
        </foreach>
        end;
    </update>

foreach鐨勪富瑕佺敤鍦ㄦ瀯寤篿n鏉′歡涓紝瀹冨彲浠ュ湪SQL璇彞涓繘琛岃凱浠d竴涓泦鍚堛俧oreach鍏冪礌鐨勫睘鎬т富瑕佹湁 item錛宨ndex錛宑ollection錛宱pen錛宻eparator錛宑lose銆俰tem琛ㄧず闆嗗悎涓瘡涓涓厓绱犺繘琛岃凱浠f椂鐨勫埆鍚嶏紝index鎸?瀹氫竴涓悕瀛楋紝鐢ㄤ簬琛ㄧず鍦ㄨ凱浠h繃紼嬩腑錛屾瘡嬈¤凱浠e埌鐨勪綅緗紝open琛ㄧず璇ヨ鍙ヤ互浠涔堝紑濮嬶紝separator琛ㄧず鍦ㄦ瘡嬈¤繘琛岃凱浠d箣闂翠互浠涔堢鍙蜂綔涓哄垎闅?絎︼紝close琛ㄧず浠ヤ粈涔堢粨鏉燂紝鍦ㄤ嬌鐢╢oreach鐨勬椂鍊欐渶鍏抽敭鐨勪篃鏄渶瀹規(guī)槗鍑洪敊鐨勫氨鏄痗ollection灞炴э紝璇ュ睘鎬ф槸蹇呴』鎸囧畾鐨勶紝浣嗘槸鍦ㄤ笉鍚屾儏鍐?涓嬶紝璇ュ睘鎬х殑鍊兼槸涓嶄竴鏍風(fēng)殑錛屼富瑕佹湁涓涓?縐嶆儏鍐碉細(xì) 
1. 濡傛灉浼犲叆鐨勬槸鍗曞弬鏁頒笖鍙傛暟綾誨瀷鏄竴涓狶ist鐨勬椂鍊欙紝collection灞炴у間負(fù)list 
2. 濡傛灉浼犲叆鐨勬槸鍗曞弬鏁頒笖鍙傛暟綾誨瀷鏄竴涓猘rray鏁扮粍鐨勬椂鍊欙紝collection鐨勫睘鎬у間負(fù)array 
3. 濡傛灉浼犲叆鐨勫弬鏁版槸澶氫釜鐨勬椂鍊欙紝鎴戜滑灝遍渶瑕佹妸瀹冧滑灝佽鎴愪竴涓狹ap浜嗭紝褰撶劧鍗曞弬鏁頒篃鍙互灝佽鎴恗ap錛屽疄闄呬笂濡傛灉浣犲湪浼犲叆鍙傛暟鐨勬椂鍊欙紝鍦╞reast閲岄潰涔熸槸浼?xì)鎶婂畠灏佽鎴愪竴涓狹ap鐨勶紝map鐨刱ey灝辨槸鍙傛暟鍚嶏紝鎵浠ヨ繖涓椂鍊檆ollection灞炴у煎氨鏄紶鍏ョ殑List鎴朼rray瀵硅薄鍦ㄨ嚜宸卞皝瑁呯殑map閲岄潰鐨刱ey

 鎵歸噺鍒犻櫎

<delete id="batchDeleteStudent" parameterType="List">
DELETE FROM STUDENT WHERE id IN
<foreach collection="list" index="index" item="item" open="(" separator="," close=")">
     #{item}
</foreach>
</delete>

鎵歸噺鏇存柊 娉ㄦ剰錛歰racle涓?褰㈠ update *** set *** where ** in(....) 榪欑璇彞 in鎵鍦ㄧ殑闆嗗悎鏈夋潯鏁伴檺鍒?涓?000鏉?/p>

<update id="batchUpdateStudent" parameterType="List">      
UPDATE STUDENT SET name = "5566" WHERE id IN
<foreach collection="list" item="item" index="index" open="(" separator="," close=")" >
#{item}
</foreach>
</update>

<update id="batchUpdateStudentWithMap" parameterType="Map" > 
UPDATE STUDENT SET name = #{name} WHERE id IN
<foreach collection="idList" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</update>

鎵歸噺鎻掑叆  mysql鍜宱racle涓嶄竴鏍?/p>

mysql錛?/span>
<insert id="batchInsertStudent" parameterType="java.util.List">  
    INSERT INTO STUDENT (id,name,sex,tel,address)  
    VALUES   
    <foreach collection="list" item="item" index="index" separator="," >  
        (#{item.id},#{item.name},#{item.sex},#{item.tel},#{item.address})  
    </foreach>  
</insert>

oracle錛?/div>
<insert id="insertBatch4Oracle" parameterType="List">
        insert into aa(a,b)
        <foreach collection="list" item="item" index="index" separator="union all" >
         銆銆select  #{item.a},#{item.b} from dual
        </foreach>
 </insert>


fly 2016-08-16 18:46 鍙戣〃璇勮
]]>myBatis鎵歸噺娣誨姞錛屼慨鏀瑰拰鍒犻櫎(杞?http://m.tkk7.com/jlin/archive/2015/07/13/426196.htmlflyflyMon, 13 Jul 2015 08:39:00 GMThttp://m.tkk7.com/jlin/archive/2015/07/13/426196.htmlhttp://m.tkk7.com/jlin/comments/426196.htmlhttp://m.tkk7.com/jlin/archive/2015/07/13/426196.html#Feedback0http://m.tkk7.com/jlin/comments/commentRss/426196.htmlhttp://m.tkk7.com/jlin/services/trackbacks/426196.html1銆佹壒閲忔坊鍔犲厓绱爏ession.insert(String string錛孫bject o)
  1. public void batchInsertStudent(){  
  2.     List<Student> ls = new ArrayList<Student>();  
  3.     for(int i = 5;i < 8;i++){  
  4.         Student student = new Student();  
  5.         student.setId(i);  
  6.         student.setName("maoyuanjun" + i);  
  7.         student.setSex("man" + i);  
  8.         student.setTel("tel" + i);  
  9.         student.setAddress("嫻欐睙鐪? + i);  
  10.         ls.add(student);  
  11.     }  
  12.     SqlSession session = SessionFactoryUtil.getSqlSessionFactory().openSession();  
  13.     session.insert("mybatisdemo.domain.Student.batchInsertStudent", ls);  
  14.     session.commit();  
  15.     session.close();  
  16. }  
  17.   
  18. <insert id="batchInsertStudent" parameterType="java.util.List">  
  19.     INSERT INTO STUDENT (id,name,sex,tel,address)  
  20.     VALUES   
  21.     <foreach collection="list" item="item" index="index" separator="," >  
  22.         (#{item.id},#{item.name},#{item.sex},#{item.tel},#{item.address})  
  23.     </foreach>  
  24. </insert>  
2銆佹壒閲忎慨鏀箂ession. insert (String string,Object o)
  1. 瀹炰緥1錛?nbsp; 
  2. public void batchUpdateStudent(){  
  3.     List<Integer> ls = new ArrayList<Integer>();  
  4.     for(int i = 2;i < 8;i++){  
  5.         ls.add(i);  
  6.     }  
  7.     SqlSession session = SessionFactoryUtil.getSqlSessionFactory().openSession();  
  8.     session.insert("mybatisdemo.domain.Student.batchUpdateStudent",ls);  
  9.     session.commit();  
  10.     session.close();  
  11. }  
  12. <update id="batchUpdateStudent" parameterType="java.util.List">  
  13.     UPDATE STUDENT SET name = "5566" WHERE id IN  
  14.     <foreach collection="list" item="item" index="index" open="(" separator="," close=")" >  
  15.         #{item}  
  16.     </foreach>  
  17. </update>  
  18.   
  19. 瀹炰緥2錛?nbsp; 
  20. public void batchUpdateStudentWithMap(){  
  21.     List<Integer> ls = new ArrayList<Integer>();  
  22.     for(int i = 2;i < 8;i++){  
  23.         ls.add(i);  
  24.     }  
  25.     Map<String,Object> map = new HashMap<String,Object>();  
  26.     map.put("idList", ls);  
  27.     map.put("name", "mmao789");  
  28.     SqlSession session = SessionFactoryUtil.getSqlSessionFactory().openSession();  
  29.     session.insert("mybatisdemo.domain.Student.batchUpdateStudentWithMap",map);  
  30.     session.commit();  
  31.     session.close();  
  32. }  
  33. <update id="batchUpdateStudentWithMap" parameterType="java.util.Map" >  
  34.     UPDATE STUDENT SET name = #{name} WHERE id IN   
  35.     <foreach collection="idList" index="index" item="item" open="(" separator="," close=")">   
  36.         #{item}   
  37.     </foreach>  
  38. </update>  

3銆佹壒閲忓垹闄ession.delete(String string,Object o)
  1. public void batchDeleteStudent(){  
  2.     List<Integer> ls = new ArrayList<Integer>();  
  3.     for(int i = 4;i < 8;i++){  
  4.         ls.add(i);  
  5.     }  
  6.     SqlSession session = SessionFactoryUtil.getSqlSessionFactory().openSession();  
  7.     session.delete("mybatisdemo.domain.Student.batchDeleteStudent",ls);  
  8.     session.commit();  
  9.     session.close();  
  10. }  
  11. <delete id="batchDeleteStudent" parameterType="java.util.List">  
  12.     DELETE FROM STUDENT WHERE id IN  
  13.     <foreach collection="list" index="index" item="item" open="(" separator="," close=")">   
  14.         #{item}   
  15.     </foreach>  
  16. </delete>  

杞嚜錛?nbsp;http://blog.csdn.net/myjlvzlp/article/details/8434376



fly 2015-07-13 16:39 鍙戣〃璇勮
]]>
oracle 澶氳杞竴鍒楋紝涓鍒楄漿澶氳(杞?http://m.tkk7.com/jlin/archive/2015/01/23/422382.htmlflyflyFri, 23 Jan 2015 03:46:00 GMThttp://m.tkk7.com/jlin/archive/2015/01/23/422382.htmlhttp://m.tkk7.com/jlin/comments/422382.htmlhttp://m.tkk7.com/jlin/archive/2015/01/23/422382.html#Feedback0http://m.tkk7.com/jlin/comments/commentRss/422382.htmlhttp://m.tkk7.com/jlin/services/trackbacks/422382.html闃呰鍏ㄦ枃

fly 2015-01-23 11:46 鍙戣〃璇勮
]]>
SQL鏌ヨ閲嶅璁板綍-杞?/title><link>http://m.tkk7.com/jlin/archive/2014/10/09/418564.html</link><dc:creator>fly</dc:creator><author>fly</author><pubDate>Thu, 09 Oct 2014 11:05:00 GMT</pubDate><guid>http://m.tkk7.com/jlin/archive/2014/10/09/418564.html</guid><wfw:comment>http://m.tkk7.com/jlin/comments/418564.html</wfw:comment><comments>http://m.tkk7.com/jlin/archive/2014/10/09/418564.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://m.tkk7.com/jlin/comments/commentRss/418564.html</wfw:commentRss><trackback:ping>http://m.tkk7.com/jlin/services/trackbacks/418564.html</trackback:ping><description><![CDATA[<blockquote style="margin-right: 0px; padding-top: 10px; padding-right: 60px; padding-left: 60px; min-height: 35px; line-height: 1.6em; font-family: Verdana, Arial, Helvetica, sans-serif; background-color: #faf7ef;"><p style="margin-top: 10px; margin-bottom: 10px; padding: 0px;">鍋囪鐜版湁涓寮犱漢鍛樿〃錛堣〃鍚嶏細(xì)Person錛夛紝鑻ユ兂灝嗗鍚嶃佽韓浠借瘉鍙楓佷綇鍧榪欎笁涓瓧孌靛畬鍏ㄧ浉鍚岀殑璁板綍鏌ユ壘鍑烘潵錛屼嬌鐢?/p><div style="margin: 0px; font-size: small; color: black; font-family: consolas, 'Courier New', courier, monospace; background-color: #ffffff;"><pre style="margin: 0em; padding: 0px; white-space: pre-wrap; word-wrap: break-word; font-family: consolas, 'Courier New', courier, monospace;"><span style="margin: 0px; padding: 0px; color: #606060;"> 1: </span><span style="margin: 0px; padding: 0px; color: #0000ff;">SELECT</span> p1.* </pre><pre style="margin: 0em; padding: 0px; white-space: pre-wrap; word-wrap: break-word; font-family: consolas, 'Courier New', courier, monospace;"><span style="margin: 0px; padding: 0px; color: #606060;"> 2: </span><span style="margin: 0px; padding: 0px; color: #0000ff;">FROM</span> persons p1,persons p2 </pre><pre style="margin: 0em; padding: 0px; white-space: pre-wrap; word-wrap: break-word; font-family: consolas, 'Courier New', courier, monospace;"><span style="margin: 0px; padding: 0px; color: #606060;"> 3: </span><span style="margin: 0px; padding: 0px; color: #0000ff;">WHERE</span> p1.id<>p2.id </pre><pre style="margin: 0em; padding: 0px; white-space: pre-wrap; word-wrap: break-word; font-family: consolas, 'Courier New', courier, monospace;"><span style="margin: 0px; padding: 0px; color: #606060;"> 4: </span><span style="margin: 0px; padding: 0px; color: #0000ff;">AND</span> p1.cardid = p2.cardid </pre><pre style="margin: 0em; padding: 0px; white-space: pre-wrap; word-wrap: break-word; font-family: consolas, 'Courier New', courier, monospace;"><span style="margin: 0px; padding: 0px; color: #606060;"> 5: </span><span style="margin: 0px; padding: 0px; color: #0000ff;">AND</span> p1.pname = p2.pname </pre><pre style="margin: 0em; padding: 0px; white-space: pre-wrap; word-wrap: break-word; font-family: consolas, 'Courier New', courier, monospace;"><span style="margin: 0px; padding: 0px; color: #606060;"> 6: </span><span style="margin: 0px; padding: 0px; color: #0000ff;">AND</span> p1.address = p2.address</pre></div><p style="margin-top: 10px; margin-bottom: 10px; padding: 0px;"></p><p style="margin-top: 10px; margin-bottom: 10px; padding: 0px;">鍙互瀹炵幇璇ュ姛鑳姐?/p></blockquote><blockquote style="margin-right: 0px; padding-top: 10px; padding-right: 60px; padding-left: 60px; min-height: 35px; line-height: 1.6em; font-family: Verdana, Arial, Helvetica, sans-serif; background-color: #faf7ef;"><p style="margin-top: 10px; margin-bottom: 10px; padding: 0px;"><strong style="margin: 0px; padding: 0px;">鍒犻櫎閲嶅璁板綍鐨凷QL璇彞</strong></p><p style="margin-top: 10px; margin-bottom: 10px; padding: 0px;">1.鐢╮owid鏂規(guī)硶</p><p style="margin-top: 10px; margin-bottom: 10px; padding: 0px;">2.鐢╣roup by鏂規(guī)硶</p><p style="margin-top: 10px; margin-bottom: 10px; padding: 0px;">3.鐢╠istinct鏂規(guī)硶</p><p style="margin-top: 10px; margin-bottom: 10px; padding: 0px;"> </p><p style="margin-top: 10px; margin-bottom: 10px; padding: 0px;"><strong style="margin: 0px; padding: 0px;">1銆傜敤rowid鏂規(guī)硶</strong></p><p style="margin-top: 10px; margin-bottom: 10px; padding: 0px;">鎹嵁oracle甯︾殑rowid灞炴э紝榪涜鍒ゆ柇錛屾槸鍚﹀瓨鍦ㄩ噸澶?璇彞濡備笅錛?nbsp;<br style="margin: 0px; padding: 0px;" /><strong style="margin: 0px; padding: 0px;">鏌ユ暟鎹? <br style="margin: 0px; padding: 0px;" /></strong>     select * from table1 a where rowid !=(select   max(rowid)   <br style="margin: 0px; padding: 0px;" />     from table1 b where a.name1=b.name1 and a.name2=b.name2......) <br style="margin: 0px; padding: 0px;" /><strong style="margin: 0px; padding: 0px;">鍒犳暟鎹細(xì)</strong> <br style="margin: 0px; padding: 0px;" />    delete   from table1 a where rowid !=(select   max(rowid)   <br style="margin: 0px; padding: 0px;" />     from table1 b where a.name1=b.name1 and a.name2=b.name2......)</p><p style="margin-top: 10px; margin-bottom: 10px; padding: 0px;"><strong style="margin: 0px; padding: 0px;">2.group by鏂規(guī)硶</strong></p><p style="margin-top: 10px; margin-bottom: 10px; padding: 0px;">鏌ユ暟鎹? <br style="margin: 0px; padding: 0px;" />select count(num), max(name) from student --鍒楀嚭閲嶅鐨勮褰曟暟錛屽茍鍒楀嚭浠栫殑name灞炴?nbsp;<br style="margin: 0px; padding: 0px;" />group by num <br style="margin: 0px; padding: 0px;" />having count(num) >1 --鎸塶um鍒嗙粍鍚庢壘鍑鴻〃涓璶um鍒楅噸澶嶏紝鍗沖嚭鐜版鏁板ぇ浜庝竴嬈?nbsp;<br style="margin: 0px; padding: 0px;" />鍒犳暟鎹細(xì) <br style="margin: 0px; padding: 0px;" />delete from student <br style="margin: 0px; padding: 0px;" />group by num <br style="margin: 0px; padding: 0px;" />having count(num) >1 <br style="margin: 0px; padding: 0px;" />榪欐牱鐨勮瘽灝辨妸鎵鏈夐噸澶嶇殑閮藉垹闄や簡銆?/p><p style="margin-top: 10px; margin-bottom: 10px; padding: 0px;"><strong style="margin: 0px; padding: 0px;">3.鐢╠istinct鏂規(guī)硶</strong> -瀵逛簬灝忕殑琛ㄦ瘮杈冩湁鐢?/p><p style="margin-top: 10px; margin-bottom: 10px; padding: 0px;">create table table_new as   select distinct *   from table1 minux <br style="margin: 0px; padding: 0px;" />truncate table table1; <br style="margin: 0px; padding: 0px;" />insert into table1 select * from table_new;</p><p style="margin-top: 10px; margin-bottom: 10px; padding: 0px;"> </p><p style="margin-top: 10px; margin-bottom: 10px; padding: 0px;"><strong style="margin: 0px; padding: 0px;">鏌ヨ鍙?qiáng)鍒犻櫎閲嶅璁板綍鐨勬栆?guī)硶澶у叏</strong> <br style="margin: 0px; padding: 0px;" />1銆佹煡鎵捐〃涓浣欑殑閲嶅璁板綍錛岄噸澶嶈褰曟槸鏍規(guī)嵁鍗曚釜瀛楁錛坧eopleId錛夋潵鍒ゆ柇</p><p style="margin-top: 10px; margin-bottom: 10px; padding: 0px;">select * from people <br style="margin: 0px; padding: 0px;" />where peopleId in (select  peopleId  from  people  group  by  peopleId  having  count(peopleId) > 1)</p><p style="margin-top: 10px; margin-bottom: 10px; padding: 0px;">2銆佸垹闄よ〃涓浣欑殑閲嶅璁板綍錛岄噸澶嶈褰曟槸鏍規(guī)嵁鍗曚釜瀛楁錛坧eopleId錛夋潵鍒ゆ柇錛屽彧鐣欐湁rowid鏈灝忕殑璁板綍 <br style="margin: 0px; padding: 0px;" />delete from people <br style="margin: 0px; padding: 0px;" />where peopleId  in (select  peopleId  from people  group  by  peopleId   having  count(peopleId) > 1) <br style="margin: 0px; padding: 0px;" />and rowid not in (select min(rowid) from  people  group by peopleId  having count(peopleId )>1)</p><p style="margin-top: 10px; margin-bottom: 10px; padding: 0px;">3銆佹煡鎵捐〃涓浣欑殑閲嶅璁板綍錛堝涓瓧孌碉級 <br style="margin: 0px; padding: 0px;" />select * from vitae a <br style="margin: 0px; padding: 0px;" />where (a.peopleId,a.seq) in  (select peopleId,seq from vitae group by peopleId,seq  having count(*) > 1)</p><p style="margin-top: 10px; margin-bottom: 10px; padding: 0px;">4銆佸垹闄よ〃涓浣欑殑閲嶅璁板綍錛堝涓瓧孌碉級錛屽彧鐣欐湁rowid鏈灝忕殑璁板綍 <br style="margin: 0px; padding: 0px;" />delete from vitae a <br style="margin: 0px; padding: 0px;" />where (a.peopleId,a.seq) in  (select peopleId,seq from vitae group by peopleId,seq having count(*) > 1) <br style="margin: 0px; padding: 0px;" />and rowid not in (select min(rowid) from vitae group by peopleId,seq having count(*)>1)</p><p style="margin-top: 10px; margin-bottom: 10px; padding: 0px;">5銆佹煡鎵捐〃涓浣欑殑閲嶅璁板綍錛堝涓瓧孌碉級錛屼笉鍖呭惈rowid鏈灝忕殑璁板綍 <br style="margin: 0px; padding: 0px;" />select * from vitae a <br style="margin: 0px; padding: 0px;" />where (a.peopleId,a.seq) in  (select peopleId,seq from vitae group by peopleId,seq having count(*) > 1) <br style="margin: 0px; padding: 0px;" />and rowid not in (select min(rowid) from vitae group by peopleId,seq having count(*)>1)</p><p style="margin-top: 10px; margin-bottom: 10px; padding: 0px;">(浜? 姣旀柟璇?鍦ˋ琛ㄤ腑瀛樺湪涓涓瓧孌?#8220;name”錛?nbsp;<br style="margin: 0px; padding: 0px;" />鑰屼笖涓嶅悓璁板綍涔嬮棿鐨?#8220;name”鍊兼湁鍙兘浼?xì)鐩稿悓锛?nbsp;<br style="margin: 0px; padding: 0px;" />鐜板湪灝辨槸闇瑕佹煡璇㈠嚭鍦ㄨ琛ㄤ腑鐨勫悇璁板綍涔嬮棿錛?#8220;name”鍊煎瓨鍦ㄩ噸澶嶇殑欏癸紱 <br style="margin: 0px; padding: 0px;" />Select Name,Count(*) From A Group By Name Having Count(*) > 1</p><p style="margin-top: 10px; margin-bottom: 10px; padding: 0px;">濡傛灉榪樻煡鎬у埆涔熺浉鍚屽ぇ鍒欏涓? <br style="margin: 0px; padding: 0px;" />Select Name,sex,Count(*) From A Group By Name,sex Having Count(*) > 1</p><p style="margin-top: 10px; margin-bottom: 10px; padding: 0px;">(涓? 鏂規(guī)硶涓</p><p style="margin-top: 10px; margin-bottom: 10px; padding: 0px;">declare @max integer,@id integer</p><p style="margin-top: 10px; margin-bottom: 10px; padding: 0px;">declare cur_rows cursor local for select 涓誨瓧孌?count(*) from 琛ㄥ悕 group by 涓誨瓧孌?having count(*) >錛?1</p><p style="margin-top: 10px; margin-bottom: 10px; padding: 0px;">open cur_rows</p><p style="margin-top: 10px; margin-bottom: 10px; padding: 0px;">fetch cur_rows into @id,@max</p><p style="margin-top: 10px; margin-bottom: 10px; padding: 0px;">while @@fetch_status=0</p><p style="margin-top: 10px; margin-bottom: 10px; padding: 0px;">begin</p><p style="margin-top: 10px; margin-bottom: 10px; padding: 0px;">select @max = @max -1</p><p style="margin-top: 10px; margin-bottom: 10px; padding: 0px;">set rowcount @max</p><p style="margin-top: 10px; margin-bottom: 10px; padding: 0px;">delete from 琛ㄥ悕 where 涓誨瓧孌?= @id</p><p style="margin-top: 10px; margin-bottom: 10px; padding: 0px;">fetch cur_rows into @id,@max</p><p style="margin-top: 10px; margin-bottom: 10px; padding: 0px;">end</p><p style="margin-top: 10px; margin-bottom: 10px; padding: 0px;">close cur_rows</p><p style="margin-top: 10px; margin-bottom: 10px; padding: 0px;">set rowcount 0</p><p style="margin-top: 10px; margin-bottom: 10px; padding: 0px;">鏂規(guī)硶浜?/p><p style="margin-top: 10px; margin-bottom: 10px; padding: 0px;">錛傞噸澶嶈褰曪紓鏈変袱涓剰涔変笂鐨勯噸澶嶈褰曪紝涓鏄畬鍏ㄩ噸澶嶇殑璁板綍錛屼篃鍗蟲墍鏈夊瓧孌靛潎閲嶅鐨勮褰曪紝浜屾槸閮ㄥ垎鍏抽敭瀛楁閲嶅鐨勮褰曪紝姣斿Name瀛楁閲嶅錛岃屽叾浠栧瓧孌典笉涓瀹氶噸澶嶆垨閮介噸澶嶅彲浠ュ拷鐣ャ?/p><p style="margin-top: 10px; margin-bottom: 10px; padding: 0px;">1銆佸浜庣涓縐嶉噸澶嶏紝姣旇緝瀹規(guī)槗瑙e喅錛屼嬌鐢?/p><p style="margin-top: 10px; margin-bottom: 10px; padding: 0px;">select distinct * from tableName</p><p style="margin-top: 10px; margin-bottom: 10px; padding: 0px;">灝卞彲浠ュ緱鍒版棤閲嶅璁板綍鐨勭粨鏋滈泦銆?/p><p style="margin-top: 10px; margin-bottom: 10px; padding: 0px;">濡傛灉璇ヨ〃闇瑕佸垹闄ら噸澶嶇殑璁板綍錛堥噸澶嶈褰曚繚鐣?鏉★級錛屽彲浠ユ寜浠ヤ笅鏂規(guī)硶鍒犻櫎</p><p style="margin-top: 10px; margin-bottom: 10px; padding: 0px;">select distinct * into #Tmp from tableName</p><p style="margin-top: 10px; margin-bottom: 10px; padding: 0px;">drop table tableName</p><p style="margin-top: 10px; margin-bottom: 10px; padding: 0px;">select * into tableName from #Tmp</p><p style="margin-top: 10px; margin-bottom: 10px; padding: 0px;">drop table #Tmp</p><p style="margin-top: 10px; margin-bottom: 10px; padding: 0px;">鍙戠敓榪欑閲嶅鐨勫師鍥犳槸琛ㄨ璁′笉鍛ㄤ駭鐢熺殑錛屽鍔犲敮涓绱㈠紩鍒楀嵆鍙В鍐熾?/p><p style="margin-top: 10px; margin-bottom: 10px; padding: 0px;">2銆佽繖綾婚噸澶嶉棶棰橀氬父瑕佹眰淇濈暀閲嶅璁板綍涓殑絎竴鏉¤褰曪紝鎿嶄綔鏂規(guī)硶濡備笅</p><p style="margin-top: 10px; margin-bottom: 10px; padding: 0px;">鍋囪鏈夐噸澶嶇殑瀛楁涓篘ame,Address錛岃姹傚緱鍒拌繖涓や釜瀛楁鍞竴鐨勭粨鏋滈泦</p><p style="margin-top: 10px; margin-bottom: 10px; padding: 0px;">select identity(int,1,1) as autoID, * into #Tmp from tableName</p><p style="margin-top: 10px; margin-bottom: 10px; padding: 0px;">select min(autoID) as autoID into #Tmp2 from #Tmp group by Name,autoID</p><p style="margin-top: 10px; margin-bottom: 10px; padding: 0px;">select * from #Tmp where autoID in(select autoID from #tmp2)</p><p style="margin-top: 10px; margin-bottom: 10px; padding: 0px;">鏈鍚庝竴涓猻elect鍗沖緱鍒頒簡Name錛孉ddress涓嶉噸澶嶇殑緇撴灉闆嗭紙浣嗗浜嗕竴涓猘utoID瀛楁錛屽疄闄呭啓鏃跺彲浠ュ啓鍦╯elect瀛愬彞涓渷鍘繪鍒楋級</p><p style="margin-top: 10px; margin-bottom: 10px; padding: 0px;">(鍥? 鏌ヨ閲嶅</p><p style="margin-top: 10px; margin-bottom: 10px; padding: 0px;">select * from tablename where id in (</p><p style="margin-top: 10px; margin-bottom: 10px; padding: 0px;">select id from tablename</p><p style="margin-top: 10px; margin-bottom: 10px; padding: 0px;">group by id</p><p style="margin-top: 10px; margin-bottom: 10px; padding: 0px;">having count(id) > 1)</p></blockquote><img src ="http://m.tkk7.com/jlin/aggbug/418564.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://m.tkk7.com/jlin/" target="_blank">fly</a> 2014-10-09 19:05 <a href="http://m.tkk7.com/jlin/archive/2014/10/09/418564.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>ORA-01034: ORACLE not available http://m.tkk7.com/jlin/archive/2014/07/22/416094.htmlflyflyTue, 22 Jul 2014 10:43:00 GMThttp://m.tkk7.com/jlin/archive/2014/07/22/416094.htmlhttp://m.tkk7.com/jlin/comments/416094.htmlhttp://m.tkk7.com/jlin/archive/2014/07/22/416094.html#Feedback0http://m.tkk7.com/jlin/comments/commentRss/416094.htmlhttp://m.tkk7.com/jlin/services/trackbacks/416094.html startup ORACLE 渚嬬▼宸茬粡鍚姩銆? Total System Global Area 535662592 bytes Fixed Size 1375792 bytes Variable Size 293601744 bytes Database Buffers 234881024 bytes Redo Buffers 5804032 bytes 鏁版嵁搴撹杞藉畬姣曘? ORA-03113: 閫氫俊閫氶亾鐨勬枃浠剁粨灝? 榪涚▼ ID: 5412 浼?xì)璇?ID: 5 搴忓垪鍙? 5 鍑虹幇涓涓柊閿欒錛歄RA-03113: 閫氫俊閫氶亾鐨勬枃浠剁粨灝撅紱鍒嗘瀽鍙兘鐢變簬鏄ㄦ櫄鏁版嵁搴撳己鍒跺叧闂紝瀵艱嚧鏂囦歡鐘舵佸彲鑳戒笉涓鑷達(dá)紝鍥犱負(fù)姝e父鍏抽棴鏁版嵁搴撲細(xì)鍚屾鏍¢獙鍚勬枃浠訛紝浣垮緱閲嶆柊鍚姩鐨勬椂鍊欐枃浠舵椂闂寸偣涓鑷淬? 鎵懼埌瑙e喅鏂規(guī)濡備笅錛? SQL> conn / as sysdba 宸茶繛鎺ュ埌絀洪棽渚嬬▼銆? SQL> startup mount ORACLE 渚嬬▼宸茬粡鍚姩銆? Total System Global Area 535662592 bytes Fixed Size 1375792 bytes Variable Size 293601744 bytes Database Buffers 234881024 bytes Redo Buffers 5804032 bytes 鏁版嵁搴撹杞藉畬姣曘? SQL> select * from v$log; GROUP# THREAD# SEQUENCE# BYTES BLOCKSIZE MEMBERS ARC ---------- ---------- ---------- ---------- ---------- ---------- --- STATUS FIRST_CHANGE# FIRST_TIME NEXT_CHANGE# NEXT_TIME ---------------- ------------- -------------- ------------ ------------- 1 1 340 52428800 512 1 NO INACTIVE 8474486 02-4鏈?-11 8522856 02-4鏈?-11 3 1 342 52428800 512 1 NO INACTIVE 8555222 06-4鏈?-11 8565162 11-4鏈?-11 2 1 343 52428800 512 1 NO CURRENT 8565162 11-4鏈?-11 2.8147E+14 SQL> alter database open resetlogs 2 ; alter database open resetlogs * 絎?1 琛屽嚭鐜伴敊璇? ORA-01139: RESETLOGS 閫夐」浠呭湪涓嶅畬鍏ㄦ暟鎹簱鎭㈠鍚庢湁鏁? SQL> recover database until time '2011-04-11 12:12:12' 瀹屾垚浠嬭川鎭㈠銆? SQL> alter database open resetlogs; 鏁版嵁搴撳凡鏇存敼銆? SQL> shutdown 鏁版嵁搴撳凡緇忓叧闂? 宸茬粡鍗歌澆鏁版嵁搴撱? ORACLE 渚嬬▼宸茬粡鍏抽棴銆? SQL> startup ORACLE 渚嬬▼宸茬粡鍚姩銆? Total System Global Area 535662592 bytes Fixed Size 1375792 bytes Variable Size 293601744 bytes Database Buffers 234881024 bytes Redo Buffers 5804032 bytes 鏁版嵁搴撹杞藉畬姣曘? 鏁版嵁搴撳凡緇忔墦寮銆? 瑙e喅鏂規(guī)硶錛氫簩 鎴戦《 瀛楀彿錛氬ぇ 涓? 灝? 鍦ㄨ瘯鍥劇櫥褰昿l/sql鏃?杈撳叆鐢ㄦ埛鍚嶏紙system/pwd)鍚庯紝Oracle鎶ュ憡涓嬪垪閿欒錛? ERROR: ORA-27101 Shared memory realm does not exist ORA-01034 ORACLE not available &<60; 鏌ラ槄浜嗙浉鍏? ORA-27101 Shared memory realm does not exist ORA-01034 ORACLE not available &<60; 鐨勮鏄庯紝瑙i噴涓篛RACLE_HOME鎴栬匫RACLE_SID璁劇疆涓嶆紜? 浣嗘鏌ash_profile浠ュ悗娌℃湁鍙戠幇閿欒; 閷榛烇紝娌掓湁闁嬪暉oracle鏈嶅嫏錛? 瑙f焙杈︽硶錛岀洿鎺ラ枊鍟無racle鐩擱棞鏁告摎搴殑鏈嶅嫏錛? 鎴栨寜鐓т笅闈㈢殑姝ラ鎿嶄綔: lsnrctl start sqlplus '/as sysdba' sql> startup emctl start dbconsole isqlplusctl start

fly 2014-07-22 18:43 鍙戣〃璇勮
]]>
銆愭晠闅滃鐞嗐慜RA-00119: invalid specification for system parameter LOCAL_LISTENERhttp://m.tkk7.com/jlin/archive/2014/07/22/416093.htmlflyflyTue, 22 Jul 2014 10:38:00 GMThttp://m.tkk7.com/jlin/archive/2014/07/22/416093.htmlhttp://m.tkk7.com/jlin/comments/416093.htmlhttp://m.tkk7.com/jlin/archive/2014/07/22/416093.html#Feedback0http://m.tkk7.com/jlin/comments/commentRss/416093.htmlhttp://m.tkk7.com/jlin/services/trackbacks/416093.html

fly 2014-07-22 18:38 鍙戣〃璇勮
]]>
oracle鏁版嵁搴撳鍏ュ鍑哄懡浠?杞?http://m.tkk7.com/jlin/archive/2014/07/17/415961.htmlflyflyThu, 17 Jul 2014 12:51:00 GMThttp://m.tkk7.com/jlin/archive/2014/07/17/415961.htmlhttp://m.tkk7.com/jlin/comments/415961.htmlhttp://m.tkk7.com/jlin/archive/2014/07/17/415961.html#Feedback0http://m.tkk7.com/jlin/comments/commentRss/415961.htmlhttp://m.tkk7.com/jlin/services/trackbacks/415961.htmloracle鏁版嵁搴撳鍏ュ鍑哄懡浠わ紒

Oracle鏁版嵁瀵煎叆瀵煎嚭imp/exp 
鍔熻兘錛歄racle鏁版嵁瀵煎叆瀵煎嚭imp/exp灝辯浉褰撲笌oracle鏁版嵁榪樺師涓庡浠姐?br /> 
澶у鎯呭喌閮藉彲浠ョ敤Oracle鏁版嵁瀵煎叆瀵煎嚭瀹屾垚鏁版嵁鐨勫浠藉拰榪樺師錛堜笉浼?xì)閫犳垚鏁版嵁鐨勪涪澶憋級銆?br /> Oracle鏈変釜濂藉錛岃櫧鐒朵綘鐨勭數(shù)鑴戜笉鏄湇鍔″櫒錛屼絾鏄綘瑁呬簡oracle瀹㈡埛绔紝騫跺緩绔嬩簡榪炴帴
 錛堥氳繃Net Configuration Assistant娣誨姞姝g‘鐨勬湇鍔″懡鍚嶏紝鍏跺疄浣犲彲浠ユ兂鎴愭槸瀹㈡埛绔笌鏈嶅姟鍣ㄧ 淇簡鏉¤礬錛岀劧鍚庢暟鎹氨鍙互琚媺榪囨潵浜嗭級
 榪欐牱浣犲彲浠ユ妸鏁版嵁瀵煎嚭鍒版湰鍦幫紝铏界劧鍙兘鏈嶅姟鍣ㄧ浣犲緢榪溿?br /> 浣犲悓鏍峰彲浠ユ妸dmp鏂囦歡浠庢湰鍦板鍏ュ埌榪滃鐨勬暟鎹簱鏈嶅姟鍣ㄤ腑銆?br /> 鍒╃敤榪欎釜鍔熻兘浣犲彲浠ユ瀯寤轟咯涓浉鍚岀殑鏁版嵁搴擄紝涓涓敤鏉ユ祴璇曪紝涓涓敤鏉ユ寮忎嬌鐢ㄣ?br /> 
鎵ц鐜錛氬彲浠ュ湪SQLPLUS.EXE鎴栬匘OS錛堝懡浠よ錛変腑鎵ц錛?br /> DOS涓彲浠ユ墽琛屾椂鐢變簬 鍦╫racle 8i 涓?nbsp; 瀹夎鐩綍\$ora10g\BIN琚緗負(fù)鍏ㄥ眬璺緞錛?br /> 璇ョ洰褰曚笅鏈塃XP.EXE涓嶪MP.EXE鏂囦歡琚敤鏉ユ墽琛屽鍏ュ鍑恒?br /> oracle鐢╦ava緙栧啓錛屾垜鎯砈QLPLUS.EXE銆丒XP.EXE銆両MP.EXE榪欎咯涓枃浠舵槸琚寘瑁呭悗鐨勭被鏂囦歡銆?br /> SQLPLUS.EXE璋冪敤EXP.EXE銆両MP.EXE浠栦滑鎵鍖呰9鐨勭被錛屽畬鎴愬鍏ュ鍑哄姛鑳姐?br /> 
涓嬮潰浠嬬粛鐨勬槸瀵煎叆瀵煎嚭鐨勫疄渚嬶紝鍚戝鍏ュ鍑虹湅瀹炰緥鍩烘湰涓婂氨鍙互瀹屾垚錛屽洜涓哄鍏ュ鍑哄緢綆鍗曘?br />鏁版嵁瀵煎嚭錛?br /> 1 灝嗘暟鎹簱TEST瀹屽叏瀵煎嚭,鐢ㄦ埛鍚峴ystem 瀵嗙爜manager 瀵煎嚭鍒癉:\daochu.dmp涓?br />   exp system/manager@TEST file=d:\daochu.dmp full=y
 2 灝嗘暟鎹簱涓璼ystem鐢ㄦ埛涓巗ys鐢ㄦ埛鐨勮〃瀵煎嚭
   exp system/manager@TEST file=d:\daochu.dmp owner=(system,sys)
 3 灝嗘暟鎹簱涓殑琛╰able1 銆乼able2瀵煎嚭
   exp system/manager@TEST file=d:\daochu.dmp tables=(table1,table2) 
 4 灝嗘暟鎹簱涓殑琛╰able1涓殑瀛楁filed1浠?00"鎵撳ご鐨勬暟鎹鍑?br />   exp system/manager@TEST file=d:\daochu.dmp tables=(table1) query=\" where filed1 like  '00%'\"
  
     涓婇潰鏄父鐢ㄧ殑瀵煎嚭錛屽浜庡帇緙╂垜涓嶅お鍦ㄦ剰錛岀敤winzip鎶奷mp鏂囦歡鍙互寰堝ソ鐨勫帇緙┿?br />                     涓嶈繃鍦ㄤ笂闈㈠懡浠ゅ悗闈?鍔犱笂 compress=y  灝卞彲浠ヤ簡

鏁版嵁鐨勫鍏?br /> 1 灝咲:\daochu.dmp 涓殑鏁版嵁瀵煎叆 TEST鏁版嵁搴撲腑銆?br />   imp system/manager@TEST  file=d:\daochu.dmp
   涓婇潰鍙兘鏈夌偣闂錛屽洜涓烘湁鐨勮〃宸茬粡瀛樺湪錛岀劧鍚庡畠?yōu)鎶ラ敊锛屽璇ヨ〃灏变笉杩涜瀵煎叆銆?br />   鍦ㄥ悗闈㈠姞涓?ignore=y 灝卞彲浠ヤ簡銆?br /> 2 灝哾:\daochu.dmp涓殑琛╰able1 瀵煎叆
 imp system/manager@TEST  file=d:\daochu.dmp  tables=(table1) 
 
 鍩烘湰涓婁笂闈㈢殑瀵煎叆瀵煎嚭澶熺敤浜嗐備笉灝戞儏鍐墊垜鏄皢琛ㄥ交搴曞垹闄わ紝鐒跺悗瀵煎叆銆?br /> 
娉ㄦ剰錛?br /> 浣犺鏈夎凍澶熺殑鏉冮檺錛屾潈闄愪笉澶熷畠浼?xì)鎻惤C轟綘銆?br /> 鏁版嵁搴撴椂鍙互榪炰笂鐨勩傚彲浠ョ敤tnsping TEST 鏉ヨ幏寰楁暟鎹簱TEST鑳藉惁榪炰笂銆?/p>

 

鏁版嵁瀵煎嚭錛?br />exp hkb/hkb@boss_14 full=y file=c:\orabackup\hkbfull.dmp log=c:\orabackup\hkbfull.log;

瀵煎嚭娉ㄦ剰浜嬮」錛氬鍑虹殑鏄綋鍓嶇敤鎴風(fēng)殑鐨勬暟鎹紝褰撳墠鐢ㄦ埛濡傛灉鏈塂BA鐨勬潈闄愶紝鍒欏鍑烘墍鏈夋暟鎹紒

鍚屽悕鐢ㄦ埛涔嬮棿鐨勬暟鎹鍏ワ細(xì)
imp hkb/hkb@xe  file=c:\orabackup\hkbfull.dmp log=c:\orabackup\hkbimp.log full=y

涓嶅悓鍚嶄箣闂寸殑鏁版嵁瀵煎叆錛?br />imp system/test@xe fromuser=hkb touser=hkb_new file=c:\orabackup\hkbfull.dmp

log=c:\orabackup\hkbimp.log;



fly 2014-07-17 20:51 鍙戣〃璇勮
]]>
主站蜘蛛池模板: 中文字幕亚洲不卡在线亚瑟| 久久香蕉国产线看观看亚洲片| 亚洲av日韩综合一区二区三区| 免费中文字幕不卡视频| 女人隐私秘视频黄www免费| 91亚洲一区二区在线观看不卡| 黄瓜视频高清在线看免费下载| 一级看片免费视频| 亚洲AV成人无码久久精品老人| 最近中文字幕无吗免费高清| 一级做a爰片久久毛片免费看| 久久精品国产亚洲AV大全| 国产精品久免费的黄网站| 国产一级a毛一级a看免费视频| 亚洲人成毛片线播放| 亚洲国产精品激情在线观看| 99re免费在线视频| 一级特黄录像免费播放中文版| 亚洲欧洲日产专区| 亚洲天堂免费在线视频| 好先生在线观看免费播放| 国产在线观看无码免费视频| 亚洲色一区二区三区四区 | 亚洲av无码无在线观看红杏| 真实乱视频国产免费观看| 日本高清不卡aⅴ免费网站| 亚洲sm另类一区二区三区| 婷婷亚洲久悠悠色悠在线播放| 免费国产a国产片高清| 亚洲性线免费观看视频成熟| 成全视成人免费观看在线看| 亚洲欧美日韩中文无线码 | 成人A级毛片免费观看AV网站| a在线免费观看视频| 羞羞的视频在线免费观看| 亚洲小视频在线播放| 亚洲成av人影院| 国产亚洲色婷婷久久99精品91| 国产精品成人四虎免费视频| 色播精品免费小视频| 国产高清不卡免费视频|