equal
deleted
inserted
replaced
111 AS maildir |
111 AS maildir |
112 FROM users |
112 FROM users |
113 LEFT JOIN domain_data USING (gid) |
113 LEFT JOIN domain_data USING (gid) |
114 LEFT JOIN domain_name USING (gid) |
114 LEFT JOIN domain_name USING (gid) |
115 LEFT JOIN maillocation USING (mid); |
115 LEFT JOIN maillocation USING (mid); |
|
116 |
|
117 CREATE OR REPLACE VIEW vmm_domain_info AS |
|
118 SELECT gid, domainname, transport, domaindir, |
|
119 count(uid) AS accounts, |
|
120 (SELECT count(DISTINCT address) |
|
121 FROM alias |
|
122 WHERE alias.gid = domain_data.gid) AS aliases, |
|
123 (SELECT count(gid) |
|
124 FROM relocated |
|
125 WHERE relocated.gid = domain_data.gid) AS relocated, |
|
126 (SELECT count(gid) |
|
127 FROM domain_name |
|
128 WHERE domain_name.gid = domain_data.gid |
|
129 AND NOT domain_name.is_primary) AS aliasdomains, |
|
130 bytes, messages |
|
131 FROM domain_data |
|
132 LEFT JOIN domain_name USING (gid) |
|
133 LEFT JOIN quotalimit USING (qid) |
|
134 LEFT JOIN transport USING (tid) |
|
135 LEFT JOIN users USING (gid) |
|
136 WHERE domain_name.is_primary |
|
137 GROUP BY gid, domainname, transport, domaindir, bytes, messages; |