-- 创建用户 dbuesr / password createUSER dbuser with PASSWORD 'password'; -- 赋予dbuser对testa的权限 grant USAGE on SCHEMA public to dbuser; -- 撤销用户对testa的所有权限 REVOKEALLON testa FROM dbuser; -- 撤销用户scheam的使用权限 REVOKEALLON SCHEMA public FROM test;
批量为某列每个值前加0
如果是MySQL正常使用CONCAT即可,例如
UPDATE students SET grade = CONCAT('0', grade)
在postgresql中可以使用 ||
UPDATE students SET grade = '0' || grade
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
before +----+-----------+----------+-------+ | id | first_name| last_name| grade | +----+-----------+----------+-------+ |1| Alice | Smith |85| |2| Bob | Johnson |90| |3| Charlie | Brown |80| +----+-----------+----------+-------+ after +----+-----------+----------+-------+ | id | first_name| last_name| grade | +----+-----------+----------+-------+ |1| Alice | Smith |085| |2| Bob | Johnson |090| |3| Charlie | Brown |080| +----+-----------+----------+-------+