Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

DQL query to find active users count

Can someone suggest me a DQL query to find the count of active users in a repository in documentum.

Below is the query I am using but it is not giving correct results, can someone suggest?

select count(user_name) from dm_user u , dm_group g  where any g.i_all_users_names = u.user_name and  u.user_state=0
like image 282
ScriptLearner Avatar asked Mar 18 '23 12:03

ScriptLearner


2 Answers

SELECT count(user_name) FROM dm_user u, dm_group g  
WHERE ANY g.i_all_users_names = u.user_name 
AND u.user_state = 1

Property user_state values are:

  • 0 user can log in (active)
  • 1 user inactive
  • 2 user locked
  • 3 user locked and inactive
like image 96
Miki Avatar answered Mar 24 '23 21:03

Miki


SELECT count(user_name) FROM dm_user WHERE user_state = 0 and r_is_group = false
like image 41
user10530795 Avatar answered Mar 24 '23 22:03

user10530795