MySQL-----暫存資料表

來源:互聯網
上載者:User

標籤:--   rom   取得資料   取數   sql   一個   sel   number   _id   

暫存資料表:

  **這是一個表和資料**

  select * from score where num > 60;

  **把這個表的資料變成一個臨時的表,作為一個臨時的表,那麼就可以再對這個暫存資料表中的資料進行查詢**

  (select * from score where num >60)as B; 

  這樣()中的內容就成了一個暫存資料表的資料,as 後的 B,就是這個暫存資料表的名字。

  **在暫存資料表中再取資料**

  select sid from (select * from score where num>60)as B;

  問題:

    在暫存資料表中取得資料有沒有限制。

  答:

    有,只是暫存資料表的有的欄位,才可以被二次取值。 例如,表score中有欄位sid,student_id,corse_id,number,所以在暫存資料表中可是取出sid欄位,如果score中沒有sid,是取不出的。

  select number from (select corse_id,number from score where num>60)as B;

  

  

MySQL-----暫存資料表

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

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.