Re: Query training -- Complex queries
From: DW (None)
Date: 02/26/04
- Next message: Niles: "Stored Procedure"
- Previous message: Tom Griffin: "Re: Database Maintenance Plan Problems"
- In reply to: Erland Sommarskog: "Re: Query training -- Complex queries"
- Next in thread: Baisong Wei[MSFT]: "Re: Query training -- Complex queries"
- Reply: Baisong Wei[MSFT]: "Re: Query training -- Complex queries"
- Reply: Erland Sommarskog: "Re: Query training -- Complex queries"
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 25 Feb 2004 16:12:42 -0800
Erland Sommarskog <sommar@algonet.se> wrote in
news:Xns949B671D1EA5Yazorman@127.0.0.1:
> As Adam pointed out, the problem with the second query is that the
> derived table is not correlated with the updated table, so you get a
> magnificent cross join, and I'm not surprise that it did not complete
> in 20 minutes.
Thanks to both of you for the answers. I will check out those books on
Amazon.
Regarding this join:
Update PositionsEOM
Set MktVal = Derived.MktVal From
(Select PM.Price * PositionsEOM.Quantity_ASD As MktVal
>From PositionsEOM Inner Join [Price Master] As PM On
PositionsEOM.Fund_ID = PM.Fund_ID And
PositionsEOM.Position_Date = PM.Price_Date) As Derived
Why is this a cross join? It has the phrase "Inner Join" in it (with
two conditions, hence the AND). I'm confused...
Thanks.
David Walker
- Next message: Niles: "Stored Procedure"
- Previous message: Tom Griffin: "Re: Database Maintenance Plan Problems"
- In reply to: Erland Sommarskog: "Re: Query training -- Complex queries"
- Next in thread: Baisong Wei[MSFT]: "Re: Query training -- Complex queries"
- Reply: Baisong Wei[MSFT]: "Re: Query training -- Complex queries"
- Reply: Erland Sommarskog: "Re: Query training -- Complex queries"
- Messages sorted by: [ date ] [ thread ]