You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
14 lines
444 B
MySQL
14 lines
444 B
MySQL
5 years ago
|
CREATE VIEW power_user_dict AS
|
||
|
SELECT
|
||
|
`power_user`.`user_id` AS `user_id`,
|
||
|
`power_dept`.`dict_id` AS `dict_id`
|
||
|
FROM
|
||
|
((
|
||
|
`power_user`
|
||
|
JOIN `mysql`.`help_topic` `b` ON ((
|
||
|
`b`.`help_topic_id` < (( length( `power_user`.`dept_id` ) - length( REPLACE ( `power_user`.`dept_id`, _latin1 ',', _latin1 '' ))) + 1 ))))
|
||
|
LEFT JOIN `power_dept` ON ((
|
||
|
`power_dept`.`dept_id` = `power_user`.`dept_id`
|
||
|
)))
|
||
|
GROUP BY
|
||
|
`power_user`.`user_id`
|