adoquery1.Close; adoquery1.SQL.Clear; adoquery1.SQL.Text := 'Select Distinct XX.diqudaima as diqudaima_N,YY.desc1 ' + ' From ( Select aa.company,substr(aa.area_code,1,11) As diqudaima,aa.period_year,aa.period_month,aa.product_code, aa.cv_code,aa.cm250,aa.cm210,bb.distance,cc.short_name ' + ' From (select company,area_code,period_year,period_month,product_code, cv_code,cm250,cm210 ' + ' from cm_dtl Where period_year = '+ nian_lirun +' and Period_month='+yue_lirun+' ) aa ,CUSTOMER_INF bb,ss_user_pz_3 cc' + ' Where aa.cv_code=bb.customer_code And aa.product_code=cc.pzbh ) XX,general_desc YY ' + ' Where XX.diqudaima=YY.gdcode Order By XX.diqudaima '; edit1.Text:= adoquery1.SQL.Text; adoquery1.Open; showmessage(inttostr(adoquery1.RecordCount));我用文本框将sql语句取出,在sql下运行都有数据,但showmessage(inttostr(adoquery1.RecordCount));就为0