m****e 发帖数: 1197 | 1 原来的是:
SELECT dbo.tblDim_Period.Code AS MnthYr, dbo.tblDim_Account.Code AS
Account, dbo.tblDim_Prism.Code AS Prism, dbo.tblDim_Facility.Code AS
Facility,
dbo.tblDim_Product.Code AS Product, CASE WHEN dbo.
tblDim_Product.Accrual IS NULL
THEN 'ACT_ACT' ELSE dbo.tblDim_Product.Accrual END AS
ProdAccrl, dbo.tblDim_Channel.Code AS Channel, dbo.tblDim_Collateral.Code AS
Collateral,
dbo.tblDim_Reprice.Code AS RePrice, dbo.tblDim_Purpo |
i****a 发帖数: 36252 | 2 what's the purpose of rewriting? or what are you trying to archive? |
m****e 发帖数: 1197 | 3 try to see the difference. can you help? thanks.
【在 i****a 的大作中提到】 : what's the purpose of rewriting? or what are you trying to archive?
|
i****a 发帖数: 36252 | 4 My question is what kind of difference you want to see. If the query is
giving you the correct result then its a correct query.
Often there are multiple ways to write a query in sql. Access generated or
not, there is no need to rewrite a query just because you can. Unless you
thing there is a performance problem.
【在 m****e 的大作中提到】 : try to see the difference. can you help? thanks.
|
m****e 发帖数: 1197 | 5 i need to add 5 fields to this, but someone told me it would take hours to
do that, because it needs "pivot" in SQL. i don't get it.
in what situation it would need pivot by adding new fields to a table?
【在 i****a 的大作中提到】 : My question is what kind of difference you want to see. If the query is : giving you the correct result then its a correct query. : Often there are multiple ways to write a query in sql. Access generated or : not, there is no need to rewrite a query just because you can. Unless you : thing there is a performance problem.
|
i****a 发帖数: 36252 | 6 If those 5 fields contains multiple rows per lookup and you need to treat
them as different columns, then you need to pivot them.
I think you should communicate with your programmers better.
【在 m****e 的大作中提到】 : i need to add 5 fields to this, but someone told me it would take hours to : do that, because it needs "pivot" in SQL. i don't get it. : in what situation it would need pivot by adding new fields to a table?
|