1
我想用表格的條件來進行授予。 表中的用戶名將獲得授權許可。用條件在mysql中的格蘭特
mysql> select * from teacher;
+------------+-----------------------+---------+----------------------------+ |
teacher_id | teacher_name | dept_id | subject |
+------------+-----------------------+---------+----------------------------+
| 1 | Daw Khine Yin Mon | 1 | English |
| 2 | Daw Ei Ei Nway | 1 | English |
| 3 | Daw Thiri Kyaw | 1 | English |
| 4 | U Nay Lin Soe | 1 | English |
| 5 | Daw Zin Mar Thwal | 1 | English |
這是老師的桌子和我做他們的用戶通過......
Create user 'Daw Khine Yin Mo' identified by 'asd';
Create user 'Daw Ei Ei Nway' identified by 'asd';
Create user 'Daw Thiri Kyaw' identified by 'asd';
Create user 'U Nay Lin Soe' identified by 'asd';
Create user 'Daw Zin Mar Thw' identified by 'asd';
我承認他們作爲...
Grant select(teacher_id,rate_no) on rating to 'Daw Khine Yin Mo','Daw Ei Ei Nway';
我要讓這樣的條件...
Grant select(teacher_id,rate_no) on rating to 'Daw Khine Yin Mo' where teacher.teacher_name ='Daw Khine Yin Mon';
我該怎麼做?
創建一個視圖,授予在視圖上的選擇。 – jarlh