Mysql進階之遊標,mysql遊標

來源:互聯網
上載者:User

Mysql進階之遊標,mysql遊標

什麼是遊標?select 語句也許一次性會取出來n條語句,那麼遊標便可以一次取出來select中的一條記錄。每取出來一條,便向下移動一次!可以實現很複雜邏輯!





上面還有有一個問題,會多出來一條記錄,怎樣搞定?

原因在於continue,而不是選擇exit;


如果用continue不行嗎?是可以的,沒發現上面帶有邏輯上有點小問題嗎?這樣解決:調節一下順序


可見有n多種方法,不就是文法問題嗎!

相關文章

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.