gpt4 book ai didi

sql-server - 在 FROM 子句中多次指定相关名称 'MR'

转载 作者:行者123 更新时间:2023-12-02 22:38:34 24 4
gpt4 key购买 nike

Create PROCEDURE [dbo].[K_RT_FixedAsset]
@fromdate datetime,
@todate datetime
AS
BEGIN

SET NOCOUNT ON;

select convert(varchar,FT.date,103)as date, MR.branch as frombranch,PD.productname as product,FT.vehicleno,FT.dcno,FT.tobranch
from K_RT_FixedAssetTransfer FT
inner join K_RT_MasterRetailStores MR on MR.sno = FT.frombranch
inner join K_RT_ProductDetails PD on PD.sno=FT.product
inner join K_RT_MasterRetailStores MR on MR.sno = FT.tobranch
where FT.date between @fromdate and @todate


END

最佳答案

您必须为 K_RT_MasterRetailStores 的每个联接使用不同的别名。

关于sql-server - 在 FROM 子句中多次指定相关名称 'MR',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20658701/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com