请教SQL问题
以下是我写的SQL语句,速度慢,问题出在下划线这个条件,大家有办法给我解决吗?
select distinct a.str_bill_no, c1.str_staffname as n_dostaff ,
c.str_staffname, d.str_crm_name, e.str_crm_dir, a.n_crm_id, a.n_sellman_id,
e.str_dir_name, sum(b.d_money * -1) as totalMoney,
sum((b.d_money * -1) - b.d_costing_price * (b.n_amount * -1)) as profitMoney,
a.str_operate_code, b.n_account_id, [dbo].[Get_t_mode](a.str_bill_no,a.str_operate_code) as t_mode
from t_mm_Business as a (NoLock)
inner join t_crm_customers as d (NoLock) on d.n_crm_id = a.n_crm_id
inner join t_mm_Business_detail as b (NoLock) on
b.n_stockaccount_id=a.n_stockaccount_id
inner join t_hr_staff as c (NoLock) on c.n_staff_id = a.n_sellman_id
inner join t_hr_staff as c1 (NoLock) on c1.n_staff_id = a.n_dostaff
inner join t_CRM_DIR as e (NoLock) on e.str_crm_dir = d.str_crm_dir
inner join t_crm_customer_types as f (NoLock) on d.e_crm_type = f.e_crm_type
inner join t_account_dir as g(NoLock) on b.n_account_id = g.n_account_id
where (a.dt_chalkup between '2009-8-28 00:00:00:000' and '2009-9-28 23:59:59:000')
and a.n_sellman_id = 1048 and d.str_crm_dir like '0%'
and a.str_operate_code in ('006','106','606')and f.z_crm_type=2
and g.str_depart_coding ='00.01.01'
and (rtrim(a.str_bill_no)+rtrim(a.str_
相关问答:
本人c#新手 可是要求要用c# ,sql2000开发c/s的工作流,一头雾水,请大家帮忙帮忙,给点思路,说的约具体越好,我也好往那个方面去学习
http://www.hxzi.com/view/61402.html
B/S版的,基本思想应该差不多的。。 ......
with adod_dict do
begin
close;
commandtext:='select bgqxcode,count(*) wjsl from wscl_wsda_file where wjnd=:tnd group by bgqxcode'; ......
大家帮忙看看这2个sql语句哪个查询的速度更快点。谢谢帮忙。比较着急。在做性能测试。
select * from
表A LEFT OUTER JOIN 表B ON (表A.id || ' ' =表B.id) ,表C , 表D, 表E
Where其他条件
select * ......
环境:1.win2003server+oracle9i
2.oracle9i字符集为AMERICAN_AMERICA.WE8ISO8859P1
3.oracle sql developer版本 1.5.5
现象描述: 1.在sql developer 中查询oracle中的某个表,中文全部显示为乱码。
......
请问:
1,如何将一张dbf表导入到sql server2000中的一张表。使用DTS该怎样实现?
2,使用网上代码:
Insert Into Tb_cj Select * from openrowset('MSDASQL','Driver=Microsoft Visual FoxPro D ......