创建一个oracle视图字段为employee_no,system,site,account_type,permmision_desc,remark。视图里的内容取自表permmison,字段为employee,permmision,site。视图中的employee_no为表employee字段内容,system都命名为ETSsystem,site为B2,permmision_desc为permmision字段内容,account_type字段当permmision字段等于view时内容为应用运行账号、permmision字段等于admin时为应用管理员账号。请帮我写成sql语句
CREATE VIEW permission_view AS SELECT e.employee_no, 'ETSsystem' AS system, 'B2' AS site, p.permmision, CASE WHEN p.permmision = 'view' THEN '应用运行账号' WHEN p.permmision = 'admin' THEN '应用管理员账号' ELSE NULL END AS account_type, p.permmision_desc, p.remark FROM employee e JOIN permmison p ON e.employee = p.employee and p.site = 'B2';
标签:账号,创建,site,视图,字段,permmision,employee From: https://www.cnblogs.com/JErryID/p/17320011.html