Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
khalik
Constraint Violating Yak Guru
443 Posts |
Posted - 2001-11-16 : 04:19:28
|
| hi when i run the below query i get this errorServer: Msg 8623, Level 16, State 2, Line 8Internal Query Processor Error: The query processor could not produce a query plan.if i remove the count((distinct acctno + mem_id)then my query works...i am using derived table to get diffrent set of data but my account no from customer table has left join with all the tables.. i hope help will reach me soonselect top 30 c.acctno,bill_name, dis.amt,dis.desp, dis.pccount,sub.amt,sub.pccount, Exc.amt,Exc.pccount from customer c,(select acctno,sum(amount) as 'amt',count (distinct acctno + mem_id) 'desp', count(distinct phone_number) 'pccount' from unit_charge_3102 group by acctno) dis,(select acctno,sum(amount) 'amt',count(distinct phone_number) 'pccount' from unit_charge_3201 group by acctno) as Sub,(select acctno,sum(amount) 'amt',count(distinct phone_number) 'pccount' from unit_charge_3202 group by acctno) as Excwhere c.acctno*=dis.acctno and c.acctno*=sub.acctno and c.acctno*=Exc.acctno order by dis.amt desc,c.acctno |
|
|
|
|
|
|
|