Data_win. ADOQ_cfcx. SQL. The Add (' select a.c FDH, a.c f_date, a.h ZXM, a.x b, a.a ge, a. z, a.z z, b.x m, (case a. iaozhi when 0 then "unregistered" when 1 then 'registration' end) as biaozhi, a.u id, d.m z from CFD a ');
Data_win. ADOQ_cfcx. SQL. The Add (' inner join ryxx on a. d. b=b.g h 'oct);
Data_win. ADOQ_cfdy. SQL. The Add (' inner join BMXX d on a.u id=d.i d ');
Data_win. ADOQ_cfcx. SQL. The Add (' group by a.c FDH, a.c f_date, a.h ZXM, a.x b, a.a ge, a. z, a.z z, b.x m, biaozhi, a.u id, d.m z ');
Data_win. ADOQ_cfcx. Open;
Data_win. ADOQ_cfcx. Active:=true; There was a
Can't dependend multi-part identifier "d.m z" error message,
Can be in SQLSERVER2005 to executing the query statement is no problem, what reason is this?
CodePudding user response:
I in 2012 debugging, your SQL statements should be true.This statement, however, why this group? If only to heavy, not have distinct?
You this statement, and no aggregation function, so it seems this group can not, with distinct directly go to heavy.
Data_win. ADOQ_cfcx. SQL. The Add (' select distinct a.c FDH, a.c f_date, a.h ZXM, a.x b, a.a ge, a. z, a.z z, b.x m, (case a. iaozhi when 0 then "unregistered" when 1 then 'registration' end) as biaozhi, a.u id, d.m z from CFD a ');
Data_win. ADOQ_cfcx. SQL. The Add (' inner join ryxx on a. d. b=b.g h 'oct);
Data_win. ADOQ_cfdy. SQL. The Add (' inner join BMXX d on a.u id=d.i d ');
Data_win. ADOQ_cfcx. Open;
Data_win. ADOQ_cfcx. Active:=true;
CodePudding user response: