視圖,就是把數(shù)據(jù)庫中單個表或多個用JOIN連接起來的表中的數(shù)據(jù),通過提取并生成到一個新窗口的方式提供給用戶察看的一種功能。數(shù)據(jù)庫開發(fā)和管理人員廣泛使用視圖功能主要基于如下兩個原因: 對數(shù)據(jù)庫安全的管理 -視圖可以通過隱藏元表中的某些敏感信息列來幫
視圖,就是把數(shù)據(jù)庫中單個表或多個用JOIN連接起來的表中的數(shù)據(jù),通過提取并生成到一個新窗口的方式提供給用戶察看的一種功能。數(shù)據(jù)庫開發(fā)和管理人員廣泛使用視圖功能主要基于如下兩個原因:mysql> select * from customer; +-------------+---------------------+--------------------+------------------+ | customer_id | customer_first_name | customer_last_name | customer_ssn | +-------------+---------------------+--------------------+------------------+ | 1 | fred | smith | ☼Q,U¶ ¢ƒ╠▒4╨☺ö| +-------------+---------------------+--------------------+------------------+ 1 row in set (0.03 sec) mysql> create view v_customer as t_name, -> select customer_id, customer_first_name, customer_last_name -> aes_decrypt(cusomer_ssn,'password') as customer_ssn -> from customer; Query OK, 0 rows affected (0.03 sec) mysql> select * from v_customer; +-------------+---------------------+--------------------+--------------+ | customer_id | customer_first_name | customer_last_name | customer_ssn | +-------------+---------------------+--------------------+--------------+ | 1 | fred | smith | 456097234 | +-------------+---------------------+--------------------+--------------+
聲明:本網(wǎng)頁內(nèi)容旨在傳播知識,若有侵權(quán)等問題請及時與本網(wǎng)聯(lián)系,我們將在第一時間刪除處理。TEL:177 7030 7066 E-MAIL:11247931@qq.com