--条件语句
(select ActorID from Ts_ActorMembers where (actortype=10 and ObjectID in(select deptid from Ts_User where UserID=10160) or (actortype=20 and ObjectID=10160)))
--合并后查询结果
select distinct flowid, string7 from app_k3flow A,
(select actorid from Ts_ActorMembers where (actortype=10 and ObjectID in(select deptid from Ts_User where UserID=10160) or (actortype=20 and ObjectID=10160))) temp
where oFlowModelID=12046
and (','+a.string7+',' like '%,'+cast(temp.ActorID as varchar(10)) +',%' or isnull(string7,'') ='')
--主导语句select string7 from app_k3flow A where oFlowModelID=12046 and string7 is not null--条件语句(select ActorID from Ts_ActorMembers where (actortype=10 and ObjectID in(select deptid from Ts_User where UserID=10160) or (actortype=20 and ObjectID=10160)))
平时开发中,常用一些模糊
查询
,例如
查询
表格user中uname包含“塔”的数据,可以使用如下三种方式:
select * from user where uname like '%塔%';select * from user where INSTR(uname,'塔');select * from user where LOCATE('塔', uname);
但是如果有一个需求,我要
查询
u...