Viewing 15 posts - 1,141 through 1,155 (of 1,473 total)
GilaMonster (11/10/2008)
Garadin (11/10/2008)
Correlated subqueries CAN (I believe the optimizer sometimes converts them to joins / derived tables for you) be run Row by Row, which is very slow.
More...
November 10, 2008 at 10:40 am
Johann Montfort (11/10/2008)
i posted sample data
Not really. You posted a big blob of text. Read the post Hodgy tried to point you to (also in my signature) for...
November 10, 2008 at 10:33 am
Added in the two extra calculations I had only comments for in my original query as correlated subqueries... one as a CASED correlated subquery.
Temporarily removed the Windowed function and the...
November 10, 2008 at 9:53 am
That would just be an update statement with a join:
UPDATE tbl_DEMOG1
SET Name = D2.Name
FROM tbl_DEMOG1
INNER JOIN tblDEMOG2 D2 ON tblDEMOG1.PatID = D2.patID
November 10, 2008 at 6:32 am
Please refer to the post in my signature for an example of how you can supply table DDL and sample data. Provide that information, with the result you're looking...
November 9, 2008 at 9:59 am
For starters, you don't need to nest your inner joins. It makes them a LOT easier to read and work with when you do something like this (You can...
November 9, 2008 at 9:53 am
Ugh. That was actually the first thing I tried... I just didn't join on date in addition to emplID and it wasn't giving me what I wanted. Barry...
November 8, 2008 at 8:44 pm
Please refer to the link in my signature for a better way to provide sample data in future posts. Try this:
[font="Courier New"]
SELECT DISTINCT
COALESCE(H1.EmplID,M.EmplID) EmplID,
COALESCE(H1.SurName,M.SurName) SurName,
...
November 8, 2008 at 3:09 pm
Your friday afternoon stumper is way better than mine :ermm:.
I can tell you it's the order by on a field from a table you're not actually selecting from that allows...
November 7, 2008 at 2:39 pm
Matt:
Thanks, that makes sense. I thought it might be something like that, but that definitely makes it more clear.
November 7, 2008 at 12:01 pm
Lynn,
That runs fine, and gives the 12K rows expected. There's no reason I couldn't have done it that way, it was just blowing my mind that the...
November 7, 2008 at 11:35 am
That's what I ended up doing to fix it, but I still don't fully understand why it should be necessary. Could you explain why a single NULL invalidates my...
November 7, 2008 at 11:30 am
They're not so much thrown... as launched. Throwing a pork chop just sounds ridiculous... I mean, who does that, pork chops are delicious... you don't want to just throw...
November 7, 2008 at 8:47 am
Kishore.P (11/7/2008)
use COALESCE function instead of IsNull or NullIf.
You can make an argument for using it instead of ISNULL, but NULLIF doesn't do the same thing as coalesce.
November 7, 2008 at 5:56 am
Group by is normally used for aggregates. To be honest, I don't need it in those queries, I just wrote them in a hurry and had originally planned on...
November 6, 2008 at 11:46 am
Viewing 15 posts - 1,141 through 1,155 (of 1,473 total)