Oracle 實現 mysql 更新 update limit,oraclemysql

來源:互聯網
上載者:User

Oracle 實現 mysql 更新 update limit,oraclemysql

oracle給人的感覺很落後,使用很不方便,Toad 這個軟體又笨又遲鈍,pl/sql更是,90年代的介面風格,速度還卡得要死。而且oracle不支援limit 。by default7#zbphp.com


update tb_news set typeid =9 where id in(     select id from (        select id from (select rownum rn ,a.* from (            select * from tb_news where typeid not in (3,6,5,9)        ) a ) where rn between 0 and 12       ) );commit;// 在結尾加這個commit 會報錯!無語



mysql的update語句支援limit? 就是我只更新一條, 例如update xxxxx limit 0 ,1

mysql 預存程序中的limit不能直接使用變數,你要換一種方式
set @sql_1 = " select * from .......limit ? ";
prepare stmt from @sql_1;
execute stmt using @step; ##你傳遞的參數,多個參數一塊加上
deallocate prepare stmt;
commit;
 
oracle 怎實現mysql 裡的limit 語句?急,

select rownum,欄位1... from table rownum>5 and rownum<10

後面不能加order by 如果要加的話.需要用子查詢
 

相關文章

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.