Grant with condition in mysql
<p>I want to do the grant with the condition of a table.
the user name in the table will get the grant permisstion.</p>

<pre><code>mysql&gt; 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             | 
</code></pre>

<p>This is the teacher table and I do them as a user by ...</p>

<pre><code>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';
</code></pre>

<p>I grant them as ... </p>

<pre><code>Grant select(teacher_id,rate_no) on rating to 'Daw Khine Yin Mo','Daw Ei Ei Nway';
</code></pre>

<p>I want to make condition such ...</p>

<pre><code>Grant select(teacher_id,rate_no) on rating to 'Daw Khine Yin Mo' where teacher.teacher_name ='Daw Khine Yin Mon';
</code></pre>

<p>How can i do that ?</p>