1.Get user
SELECT * FROM dm_user WHERE r_is_group = 0
2.Get Group
SELECT * FROM dm_group WHERE group_class = 'group'
3.Get File
SELECT * FROM dm_document(ALL) WHEREFOLDER('{0}')
SELECT * FROM dm_document(ALL) WHEREFOLDER(ID('{0}'))
4.Get Version
SELECT r_object_id,r_version_label FROM dm_document(ALL) WHERE i_chronicle_id = '{0}' ORDER BY r_version_label DESC ENABLE(RETURN_TOP 3)
5.Get Regular Document
SELECT r_object_id FROM dm_document WHEREFOLDER(ID('{0}')) AND (r_assembled_from_id = '0000000000000000' OR r_assembled_from_id ISNULL) AND (i_chronicle_id NOTIN (SELECT i_chronicle_id FROM dm_document(ALL) WHEREFOLDER(ID('{0}')) AND (r_is_virtual_doc != 0 OR r_link_cnt != 0)))
6.Get Virtual Document
SELECT r_object_id FROM dm_document WHERE i_chronicle_id IN (SELECT i_chronicle_id FROM dm_document(ALL) WHEREFOLDER(ID('{0}')) AND (r_is_virtual_doc != 0 OR r_link_cnt != 0))
7.Get Snapshot
SELECT r_object_id FROM dm_document WHEREFOLDER(ID('{0}')) AND r_is_virtual_doc = FALSEAND r_assembled_from_id != '0000000000000000' AND r_assembled_from_id ISNOTNULL
8.Get attribute of user types
SELECT dd.attr_name,df.parent_type FROM dm_foreign_key df, dmi_dd_attr_info dd WHERE (df.parent_type = 'dm_user' OR df.parent_type = 'dm_group') ANDANY dd.foreign_keys = df.r_object_id AND type_name = '{0}'