Office中国论坛/Access中国论坛

标题: 靠~~Access的查询这么复杂 [打印本页]

作者: goodidea    时间: 2004-7-1 20:07
标题: 靠~~Access的查询这么复杂
靠~~Access的查询这么复杂?

晕晕晕晕晕晕~~~`



SELECT tblselect.*,

tblselectsub.*,

tblmodel.Model,

tblmodel.q0,

tblmodel.Qv100,

tblmodel.dPmax,

tblmodel.nmax,

tblCLImodelc.Frame,

tblCLImodelc.Limit,

tblCLImodelc.Max,

tblselect.P1 AS AP,

Forms!zfsel!fqv100 AS FQV100,

[Qv100]*[FQV100]*Sqr(1.293*(Psi2Mbar([DP]+[VP]))/([RHO1]*100)) AS Qv,

Ft32Mt3([Q1])+[Qv] AS Q0H, 1000*[Q0H]/[q0] AS n,

[RPMmax]*[nmax] AS Lnmax,

Forms!zfsel!RPMmin*[nmax] AS nmin,

[n]/[nmax] AS nnmax, [nmax]-[n] AS [nmax-n],

Ft32Mt3([Q1])/[Q0H] AS nv, (Psi2Mbar([DP]+[VP]))/([cp]*[Rho1]*[nv]*10) AS dt,

Rank2Kel([T1]) AS Tk, Rank2C([T1])+[dt] AS t2c,

[Q0H]*(Psi2Mbar([DP]+[VP]))/600 AS Pthkw,

[n5]*[n]^5 AS sn5, [n4]*[n]^4 AS sn4,

[n3]*[n]^3 AS sn3, [n2]*[n]^2 AS sn2,

[n1]*[n] AS sn1,

tblCLImodelc.n0, [sn5]+[sn4]+[sn3]+[sn2]+[sn1]+[n0] AS pv,

[pthkw]+[pv] AS Pkw,

Ft32Mt3([Q1])*(Psi2Mbar([DP]+[VP]))/600 AS Pq1,

[Pq1]/[pkw] AS Meff,

(1/([n]/[nmax]))*((1/((Psi2Mbar([DP]+[VP]))/[dpmax]))^3)*40000 AS L10,

tblCLIsound.Hood,

[n]*[x] AS a, Psi2Mbar([DP])*[y] AS b,

[xy]*[n]*Psi2Mbar([DP]) AS c, [x2]*[n]^2 AS d,

[y2]*Psi2Mbar([DP])^2 AS e, [y3]*Psi2Mbar([DP])^3 AS f,

[x2y]*[n]^2*Psi2Mbar([DP]) AS g,

[x2y2]*[n]^2*Psi2Mbar([DP])^2 AS h,

[xy2]*[n]*Psi2Mbar([DP])^2 AS i,

[xy3]*[n]*Psi2Mbar([DP])^3 AS j,

tblCLIsound.Add,

[a]++[c]+[d]+[e]+[f]+[g]+[h]++[j]+[add] AS Zdb1

FROM (((tblselect LEFT JOIN tblmodel ON tblselect.ModelID = tblmodel.ModelID)

LEFT JOIN tblCLIsound ON tblmodel.ModelID = tblCLIsound.ModelID)

LEFT JOIN tblCLImodelc ON tblmodel.ModelID = tblCLImodelc.ModelID)

LEFT JOIN tblselectsub ON tblselect.SelID = tblselectsub.SelID

WHERE (((tblCLImodelc.Max)>=(SELECT Max( Ft32Mt3 ([Q1])) AS [Max]

FROM tblselectsub GROUP BY tblselectsub.SelID

HAVING (((tblselectsub.SelID)=[Forms]![zfsel]![zfsela].[Form]![SelID]))))

AND ((tblselect.ModelID)=[Forms]![zfsel]![ModID])

AND ((tblselectsub.SelID)=[Forms]![zfsel]![SelID]))

ORDER BY tblmodel.q0, tblCLImodelc.Max, tblselectsub.ISelID;
作者: lwwvb    时间: 2004-7-2 00:00
傻,可以分为几个查询的呀!
作者: zhengjialon    时间: 2004-7-2 00:36
呵呵,比你这个还要复杂的我也做过,到后来多的无法执行。不得不找其它方法“瘦身”
作者: esmile    时间: 2004-7-6 21:49
提示: 作者被禁止或删除 内容自动屏蔽
作者: RQF    时间: 2004-7-24 18:13
把这个复制到QBE图形查询界面,用SQL语句就是太复杂,但QBE中很好理解和记忆.




欢迎光临 Office中国论坛/Access中国论坛 (http://www.office-cn.net/) Powered by Discuz! X3.3