两种写法,一是参数查询(建议这种,你可以查一下),二是拼接sql:
DateTime today=DateTime.Now.Date.AddDays(1)string sql =
"select Risetime from suntime where Risetime > '"
+ today.ToString()
+ "'"
select top 1 *from (select *
from (select distinct a.ol_id OL_id,
a.ol_nbr购物车ID,
mm.receive_date 消息落地表时间,
a.so_date 购物车抽取时间,
bb.create_date 产品服务定单创建时间,
aa.create_date 资源变更单创建时间,
oo.create_date 流程启动时间,
k.receive_date 报竣时间,
cc.flow_id
from his_wf_event_od mm
join his_srv_tache_order mf
on mf.flow_id = mm.flow_id
join his_srv_crm_tache_order a
on a.to_id = mf.to_id
join his_SRV_B2O_BUSI_ORDER b
on a.to_id = b.to_id
join his_SRV_B2O_BUSI_ORDER_2_PSO bb
on b.action_id = bb.action_id
join his_srv_pso_2_ro aa
on aa.pso_id = bb.pso_id
join his_srv_res_order c
on c.ro_id = aa.ro_id
join his_srv_ro_flow cc
on cc.ro_id = c.ro_id
join his_wf_event_finish k
on cc.flow_id = k.flow_id
join his_srv_ro_event oo
on oo.ro_id = cc.ro_id
where a.ol_id in (250075955915)))
order by oo.create_date desc
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)