SQL query different departments of personnel information

Statisticians need information about the current library in different sectors:

SELECT name,asname,(CASE org_member.title WHEN 'ME' THEN '成员' WHEN 'M' THEN '负责人 END),email from org_member JOIN account ON account.user_ptr_id=org_member.user_id RIGHT JOIN org ON org.id=org_member.org_id
WHERE org_id in(select id from org WHERE yn=1) and email not LIKE '%XXX%' ORDER BY NAME

Association members and organization chart for post-sheets & & & display replacement sorted by name according to the mailbox distinguished department

Guess you like

Origin www.cnblogs.com/qinghuaL/p/10972742.html