|
|
发表于 2007/7/16 19:57:22
|
显示全部楼层
楼主好久没更新了,我来补充点吧!
M6常用sql:
--查看对象或属性信息
select b.objectname,attributename,title,remarks,b.description,columnname,maxtype,sameasattribute,a.classname,a.DOMAINID
from MAXATTRIBUTE a ,maxobject b
where a.objectname=upper('REORDERPAD') and a.objectname=b.objectname order by attributename
--查看关系
select * from maxrelationship where name=upper('WPMATERIAL') and parent='FAILURELIST' for update;
--查看应用
select * from maxapps where app='ACTIVITY'
--查看索引
select * FROM MAXSYSINDEXES
SELECT * FROM MAXSYSKEYS
--人员
select * from person where personid='YF'
select * from PERSONCAL where personid='YF'
--人员组成员
select a.description,b.resppartygroup from persongroup a,PERSONGROUPTEAM b where a.persongroup=b.persongroup and a.persongroup = 'AG_FIRE'
select * from persongroup where persongroup = 'SHUAXUE'
select * from PERSONGROUPTEAM where persongroup = 'AG_FIRE'
select a.persongroup,b.description,a.* from PERSONGROUPTEAM a,persongroup b
where respparty in( '戴玲') and a.persongroup=b.persongroup
--查询员工信息
select a.laborcode,b.displayname ,a.*,b.* from labor a, person b where a.personid=b.personid and laborcode='yf'
--员工
select * from labor;
--maximo用户
Select * From maxuser Where userid LIKE '罗%'
select loginid,a.* from maxuser a where userid='刘';
select * from GROUPUSER where userid like '周永%';
Select * From GROUPUSER Where USERID In (
Select userid From groupuser Having Count(*) =1 Group By userid) And GROUPNAME='WOMG' ;
Select * From maxuser;
--角色
select * from maxrole
--角色中对应的人员组的成员为0的人员组
select
(select count(*) from PERSONGROUPTEAM b where a.persongroup=b.persongroup
and b.persongroup in (select persongroup from maxrole c where c.persongroup=b.persongroup )) as ct
,a.persongroup,a.description from persongroup a
where (select count(*) from PERSONGROUPTEAM b where a.persongroup=b.persongroup
and b.persongroup in (select persongroup from maxrole c where c.persongroup=b.persongroup )) =0
group by a.persongroup,a.description
--查看自增字段
select * from autokey;
--查询应用的service的classname
select * from MAXSERVICE WHERE servicename=upper('INVENTORY')
--注册lookup
SELECT * FROM MAXLOOKUPMAP
--值列表
select a.domainid,a.description,maxvalue,value,b.description from MaxDomain a,SynonymDomain b
where a.domainid=b.domainid
and a.domainid = upper('wostatus')
AND VALUE='AG'
and a.description like '%发放%'
select * from ALNDOMAIN a WHERE a.domainid = upper('CREWID')
select * from SynonymDomain WHERE domainid = upper('wostatus')
--工单类型
select * from worktype
--工单状态
select a.domainid,a.description,maxvalue,value,b.description from MaxDomain a,SynonymDomain b
where a.domainid=b.domainid and a.domainid=upper('WOSTATUS')
--工单类型
select a.domainid,a.description,maxvalue,value,b.description from MaxDomain a,SynonymDomain b
where a.domainid=b.domainid and a.domainid=upper('worktype')
--采购申请单状态
select a.domainid,a.description,maxvalue,value,b.description from MaxDomain a,SynonymDomain b
where a.domainid=b.domainid and a.domainid=upper('PRSTATUS')
--查看邮箱数据
select a.ASSIGNSTATUS,a.* from wfassignment a order by startdate
--查询菜单
select * from sigoption where app=UPPER('receipts')
--应用程序权限表
select * from APPLICATIONAUTH where app=UPPER('receipts')
--转到的信息,为应用程序和选项指定级别和嵌套
select * from MAXMENU where menutype = 'MODULE'
--查询工作流
select * from wfprocess where description like '%报缺%'
select * from wfnode where processid='26' order by nodeid; --节点
select * from action where objectname='WORKORDER'
--查看文档服务器
select * from APPDOCTYPE where app='FATRAN'
select * from doctypes where doctype='业务审批'
select * from DOCLINKS where doctype='业务审批'
select * from DOCLINKS where keytable='WORKORDER'
--查看工作流
select * from wfinstance where ownerid = (select workorderid from workorder where wonum='2176')
--查看设备
SELECT * FROM LOCANCESTOR WHERE location in (select location from locancestor where ancestor='NULL')
select * from locations where location in ('SWIC021','34AWIC021','4TB17IC02','FUCKD2')
--字段控制
select * from MEXFLDCTRL
select * from MEXFLDCTRLATTRIB
--查看分类
select * from CLASSSTRUCTURE
select * from CLASSIFICATION
--查看工作流
Select a.* From wfassignment A Where wfid=0 And processNAME='WOTRACKING' And processrev=13;
Select * From wfassignment Where ownerid In (Select workorderid From workorder Where wonum='3220')
Select * From wfnode
Select * From wfaction Where processNAME='WOTRACKING' And processrev=13 Order By processname,processrev
--位置
select count(*) from locations where location not in (select location from lochierarchy)
--位置层次结构,本身与父级
select count(*) from lochierarchy
select * from lochierarchy where location=parent
--搜索位置层次结构,本身与所有父级
select count(*) from locancestor |
|