gpt4 book ai didi

mysql - 在 mysql 中有条件地授予

转载 作者:行者123 更新时间:2023-11-28 23:36:06 25 4
gpt4 key购买 nike

<分区>

我想用一个表的条件来做grant。表中的用户名将获得授权权限。

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 |

这是 teacher 表,我作为用户通过 ...

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';

我该怎么做?

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com